mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
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:
parent
d4d864cd2c
commit
bb62e724a1
34 changed files with 2408 additions and 361 deletions
52
internal/domain/feed.go
Normal file
52
internal/domain/feed.go
Normal file
|
@ -0,0 +1,52 @@
|
|||
package domain
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
type FeedCacheRepo interface {
|
||||
Get(bucket string, key string) ([]byte, error)
|
||||
Exists(bucket string, key string) (bool, error)
|
||||
Put(bucket string, key string, val []byte, ttl time.Duration) error
|
||||
Delete(bucket string, key string) error
|
||||
}
|
||||
|
||||
type FeedRepo interface {
|
||||
FindByID(ctx context.Context, id int) (*Feed, error)
|
||||
FindByIndexerIdentifier(ctx context.Context, indexer string) (*Feed, error)
|
||||
Find(ctx context.Context) ([]Feed, error)
|
||||
Store(ctx context.Context, feed *Feed) error
|
||||
Update(ctx context.Context, feed *Feed) error
|
||||
ToggleEnabled(ctx context.Context, id int, enabled bool) error
|
||||
Delete(ctx context.Context, id int) error
|
||||
}
|
||||
|
||||
type Feed struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Indexer string `json:"indexer"`
|
||||
Type string `json:"type"`
|
||||
Enabled bool `json:"enabled"`
|
||||
URL string `json:"url"`
|
||||
Interval int `json:"interval"`
|
||||
Capabilities []string `json:"capabilities"`
|
||||
ApiKey string `json:"api_key"`
|
||||
Settings map[string]string `json:"settings"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
IndexerID int `json:"-"`
|
||||
Indexerr FeedIndexer `json:"-"`
|
||||
}
|
||||
|
||||
type FeedIndexer struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Identifier string `json:"identifier"`
|
||||
}
|
||||
|
||||
type FeedType string
|
||||
|
||||
const (
|
||||
FeedTypeTorznab FeedType = "TORZNAB"
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue