mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(indexers): indexers store and update (#318)
* fix(indexers): store and update set map * chore: update go to 1.18
This commit is contained in:
parent
f9cf837486
commit
aa500fd13d
4 changed files with 13 additions and 17 deletions
4
go.mod
4
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module github.com/autobrr/autobrr
|
module github.com/autobrr/autobrr
|
||||||
|
|
||||||
go 1.17
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Masterminds/squirrel v1.5.1
|
github.com/Masterminds/squirrel v1.5.1
|
||||||
|
@ -8,7 +8,7 @@ require (
|
||||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
|
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
|
||||||
github.com/dcarbone/zadapters/zstdlog v0.3.1
|
github.com/dcarbone/zadapters/zstdlog v0.3.1
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.0
|
||||||
github.com/ergochat/irc-go v0.1.0
|
github.com/ergochat/irc-go v0.1.1-0.20220619021632-5b9a0365c50a
|
||||||
github.com/fsnotify/fsnotify v1.5.4
|
github.com/fsnotify/fsnotify v1.5.4
|
||||||
github.com/gdm85/go-libdeluge v0.5.5
|
github.com/gdm85/go-libdeluge v0.5.5
|
||||||
github.com/go-chi/chi v1.5.4
|
github.com/go-chi/chi v1.5.4
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -207,6 +207,8 @@ github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
github.com/ergochat/irc-go v0.1.0 h1:jBHUayERH9SiPOWe4ePDWRztBjIQsU/jwLbbGUuiOWM=
|
github.com/ergochat/irc-go v0.1.0 h1:jBHUayERH9SiPOWe4ePDWRztBjIQsU/jwLbbGUuiOWM=
|
||||||
github.com/ergochat/irc-go v0.1.0/go.mod h1:2vi7KNpIPWnReB5hmLpl92eMywQvuIeIIGdt/FQCph0=
|
github.com/ergochat/irc-go v0.1.0/go.mod h1:2vi7KNpIPWnReB5hmLpl92eMywQvuIeIIGdt/FQCph0=
|
||||||
|
github.com/ergochat/irc-go v0.1.1-0.20220619021632-5b9a0365c50a h1:u05lmgGzcP7WyhH52I8Xn1yex88KqR3pmO3VHWfcJCQ=
|
||||||
|
github.com/ergochat/irc-go v0.1.1-0.20220619021632-5b9a0365c50a/go.mod h1:2vi7KNpIPWnReB5hmLpl92eMywQvuIeIIGdt/FQCph0=
|
||||||
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
|
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
|
||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||||
|
|
|
@ -343,6 +343,8 @@ func (s *service) addIndexer(indexer domain.Indexer) error {
|
||||||
s.torznabIndexers[indexer.Identifier] = indexerDefinition
|
s.torznabIndexers[indexer.Identifier] = indexerDefinition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.mappedDefinitions[indexer.Identifier] = indexerDefinition
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,6 +375,8 @@ func (s *service) updateIndexer(indexer domain.Indexer) error {
|
||||||
s.torznabIndexers[indexer.Identifier] = indexerDefinition
|
s.torznabIndexers[indexer.Identifier] = indexerDefinition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.mappedDefinitions[indexer.Identifier] = indexerDefinition
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
import { Fragment, useState } from "react";
|
import { Fragment, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery } from "react-query";
|
||||||
import Select, {
|
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
|
||||||
components,
|
|
||||||
ControlProps,
|
|
||||||
InputProps,
|
|
||||||
MenuProps,
|
|
||||||
OptionProps
|
|
||||||
} from "react-select";
|
|
||||||
import { Field, Form, Formik, FormikValues } from "formik";
|
|
||||||
import type { FieldProps } from "formik";
|
import type { FieldProps } from "formik";
|
||||||
|
import { Field, Form, Formik, FormikValues } from "formik";
|
||||||
|
|
||||||
import { XIcon } from "@heroicons/react/solid";
|
import { XIcon } from "@heroicons/react/solid";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
|
@ -18,11 +12,7 @@ import { sleep, slugify } from "../../utils";
|
||||||
import { queryClient } from "../../App";
|
import { queryClient } from "../../App";
|
||||||
import DEBUG from "../../components/debug";
|
import DEBUG from "../../components/debug";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import {
|
import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs";
|
||||||
TextFieldWide,
|
|
||||||
PasswordFieldWide,
|
|
||||||
SwitchGroupWide
|
|
||||||
} from "../../components/inputs";
|
|
||||||
import { SlideOver } from "../../components/panels";
|
import { SlideOver } from "../../components/panels";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
|
|
||||||
|
@ -76,7 +66,7 @@ const IrcSettingFields = (ind: IndexerDefinition, indexer: string) => {
|
||||||
<div className="px-6 space-y-1">
|
<div className="px-6 space-y-1">
|
||||||
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">IRC</Dialog.Title>
|
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">IRC</Dialog.Title>
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-200">
|
<p className="text-sm text-gray-500 dark:text-gray-200">
|
||||||
Networks, channels and invite commands are configured automatically.
|
Networks, channels and invite commands are configured automatically.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{ind.irc.settings.map((f: IndexerSetting, idx: number) => {
|
{ind.irc.settings.map((f: IndexerSetting, idx: number) => {
|
||||||
|
@ -107,7 +97,7 @@ const FeedSettingFields = (ind: IndexerDefinition, indexer: string) => {
|
||||||
<div className="px-6 space-y-1">
|
<div className="px-6 space-y-1">
|
||||||
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">Torznab</Dialog.Title>
|
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">Torznab</Dialog.Title>
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-200">
|
<p className="text-sm text-gray-500 dark:text-gray-200">
|
||||||
Torznab feed
|
Torznab feed
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue