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:
Ludvig Lundgren 2022-06-19 22:22:27 +02:00 committed by GitHub
parent f9cf837486
commit aa500fd13d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 17 deletions

4
go.mod
View file

@ -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
View file

@ -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=

View file

@ -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
} }

View file

@ -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";