Skip to content

Commit

Permalink
fix(indexers): indexers store and update (#318)
Browse files Browse the repository at this point in the history
* fix(indexers): store and update set map

* chore: update go to 1.18
  • Loading branch information
ludviglundgren committed Jun 19, 2022
1 parent f9cf837 commit aa500fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions go.mod
@@ -1,14 +1,14 @@
module github.com/autobrr/autobrr

go 1.17
go 1.18

require (
github.com/Masterminds/squirrel v1.5.1
github.com/anacrolix/torrent v1.11.0
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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Expand Up @@ -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=
Expand Down
4 changes: 4 additions & 0 deletions internal/indexer/service.go
Expand Up @@ -343,6 +343,8 @@ func (s *service) addIndexer(indexer domain.Indexer) error {
s.torznabIndexers[indexer.Identifier] = indexerDefinition
}

s.mappedDefinitions[indexer.Identifier] = indexerDefinition

return nil
}

Expand Down Expand Up @@ -373,6 +375,8 @@ func (s *service) updateIndexer(indexer domain.Indexer) error {
s.torznabIndexers[indexer.Identifier] = indexerDefinition
}

s.mappedDefinitions[indexer.Identifier] = indexerDefinition

return nil
}

Expand Down
20 changes: 5 additions & 15 deletions 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";
Expand All @@ -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";

Expand Down Expand Up @@ -76,7 +66,7 @@ const IrcSettingFields = (ind: IndexerDefinition, indexer: string) => {
<div className="px-6 space-y-1">
<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">
Networks, channels and invite commands are configured automatically.
Networks, channels and invite commands are configured automatically.
</p>
</div>
{ind.irc.settings.map((f: IndexerSetting, idx: number) => {
Expand Down Expand Up @@ -107,7 +97,7 @@ const FeedSettingFields = (ind: IndexerDefinition, indexer: string) => {
<div className="px-6 space-y-1">
<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">
Torznab feed
Torznab feed
</p>
</div>

Expand Down

0 comments on commit aa500fd

Please sign in to comment.