feat: add torznab feed support (#246)

* feat(torznab): initial impl

* feat: torznab processing

* feat: torznab more scheduling

* feat: feeds web

* feat(feeds): create on indexer create

* feat(feeds): update migration

* feat(feeds): restart on update

* feat(feeds): set cron schedule

* feat(feeds): use basic empty state

* chore: remove duplicate migrations

* feat: parse release size from torznab

* chore: cleanup unused code
This commit is contained in:
Ludvig Lundgren 2022-04-25 12:58:54 +02:00 committed by GitHub
parent d4d864cd2c
commit bb62e724a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 2408 additions and 361 deletions

View file

@ -11,6 +11,8 @@ import (
"github.com/autobrr/autobrr/internal/announce"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/internal/logger"
"github.com/autobrr/autobrr/internal/release"
"github.com/ergochat/irc-go/ircevent"
"github.com/ergochat/irc-go/ircmsg"
"github.com/rs/zerolog/log"
@ -54,7 +56,7 @@ func (h *channelHealth) resetMonitoring() {
type Handler struct {
network *domain.IrcNetwork
announceSvc announce.Service
releaseSvc release.Service
announceProcessors map[string]announce.Processor
definitions map[string]*domain.IndexerDefinition
@ -71,11 +73,11 @@ type Handler struct {
channelHealth map[string]*channelHealth
}
func NewHandler(network domain.IrcNetwork, definitions []domain.IndexerDefinition, announceSvc announce.Service) *Handler {
func NewHandler(network domain.IrcNetwork, definitions []domain.IndexerDefinition, releaseSvc release.Service) *Handler {
h := &Handler{
client: nil,
network: &network,
announceSvc: announceSvc,
releaseSvc: releaseSvc,
definitions: map[string]*domain.IndexerDefinition{},
announceProcessors: map[string]announce.Processor{},
validAnnouncers: map[string]struct{}{},
@ -104,7 +106,7 @@ func (h *Handler) InitIndexers(definitions []domain.IndexerDefinition) {
// some channels are defined in mixed case
channel = strings.ToLower(channel)
h.announceProcessors[channel] = announce.NewAnnounceProcessor(h.announceSvc, definition)
h.announceProcessors[channel] = announce.NewAnnounceProcessor(h.releaseSvc, definition)
h.channelHealth[channel] = &channelHealth{
name: channel,