From aa500fd13db6031ec77689b04a982575702c3fd5 Mon Sep 17 00:00:00 2001 From: Ludvig Lundgren Date: Sun, 19 Jun 2022 22:22:27 +0200 Subject: [PATCH] fix(indexers): indexers store and update (#318) * fix(indexers): store and update set map * chore: update go to 1.18 --- go.mod | 4 ++-- go.sum | 2 ++ internal/indexer/service.go | 4 ++++ web/src/forms/settings/IndexerForms.tsx | 20 +++++--------------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 4e3d33651d..5a10add02f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/autobrr/autobrr -go 1.17 +go 1.18 require ( github.com/Masterminds/squirrel v1.5.1 @@ -8,7 +8,7 @@ require ( github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef github.com/dcarbone/zadapters/zstdlog v0.3.1 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/gdm85/go-libdeluge v0.5.5 github.com/go-chi/chi v1.5.4 diff --git a/go.sum b/go.sum index 2f80e723f4..1254dd219a 100644 --- a/go.sum +++ b/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/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.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/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= diff --git a/internal/indexer/service.go b/internal/indexer/service.go index bc0f4072ae..a23ae1311a 100644 --- a/internal/indexer/service.go +++ b/internal/indexer/service.go @@ -343,6 +343,8 @@ func (s *service) addIndexer(indexer domain.Indexer) error { s.torznabIndexers[indexer.Identifier] = indexerDefinition } + s.mappedDefinitions[indexer.Identifier] = indexerDefinition + return nil } @@ -373,6 +375,8 @@ func (s *service) updateIndexer(indexer domain.Indexer) error { s.torznabIndexers[indexer.Identifier] = indexerDefinition } + s.mappedDefinitions[indexer.Identifier] = indexerDefinition + return nil } diff --git a/web/src/forms/settings/IndexerForms.tsx b/web/src/forms/settings/IndexerForms.tsx index 9fe7bab618..0df6f32113 100644 --- a/web/src/forms/settings/IndexerForms.tsx +++ b/web/src/forms/settings/IndexerForms.tsx @@ -1,15 +1,9 @@ import { Fragment, useState } from "react"; import { toast } from "react-hot-toast"; import { useMutation, useQuery } from "react-query"; -import Select, { - components, - ControlProps, - InputProps, - MenuProps, - OptionProps -} from "react-select"; -import { Field, Form, Formik, FormikValues } from "formik"; +import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select"; import type { FieldProps } from "formik"; +import { Field, Form, Formik, FormikValues } from "formik"; import { XIcon } from "@heroicons/react/solid"; import { Dialog, Transition } from "@headlessui/react"; @@ -18,11 +12,7 @@ import { sleep, slugify } from "../../utils"; import { queryClient } from "../../App"; import DEBUG from "../../components/debug"; import { APIClient } from "../../api/APIClient"; -import { - TextFieldWide, - PasswordFieldWide, - SwitchGroupWide -} from "../../components/inputs"; +import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs"; import { SlideOver } from "../../components/panels"; import Toast from "../../components/notifications/Toast"; @@ -76,7 +66,7 @@ const IrcSettingFields = (ind: IndexerDefinition, indexer: string) => {
IRC

- Networks, channels and invite commands are configured automatically. + Networks, channels and invite commands are configured automatically.

{ind.irc.settings.map((f: IndexerSetting, idx: number) => { @@ -107,7 +97,7 @@ const FeedSettingFields = (ind: IndexerDefinition, indexer: string) => {
Torznab

- Torznab feed + Torznab feed