mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(indexers): delete feed with indexer (#1810)
* fix(indexers): delete feed in one go * fix(indexers): sort imports * refactor(feeds): db methods for find
This commit is contained in:
parent
41216babe6
commit
40fe3e9f54
10 changed files with 167 additions and 92 deletions
|
@ -5,6 +5,13 @@ package domain
|
|||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
EventReleaseStoreActionStatus = "release:store-action-status"
|
||||
EventReleasePushStatus = "release:push"
|
||||
EventNotificationSend = "events:notification"
|
||||
EventIndexerDelete = "indexer:delete"
|
||||
)
|
||||
|
||||
type EventsReleasePushed struct {
|
||||
ReleaseName string
|
||||
Filter string
|
||||
|
|
|
@ -21,8 +21,8 @@ type FeedCacheRepo interface {
|
|||
}
|
||||
|
||||
type FeedRepo interface {
|
||||
FindOne(ctx context.Context, params FindOneParams) (*Feed, error)
|
||||
FindByID(ctx context.Context, id int) (*Feed, error)
|
||||
FindByIndexerIdentifier(ctx context.Context, indexer string) (*Feed, error)
|
||||
Find(ctx context.Context) ([]Feed, error)
|
||||
GetLastRunDataByID(ctx context.Context, id int) (string, error)
|
||||
Store(ctx context.Context, feed *Feed) error
|
||||
|
@ -91,3 +91,9 @@ type FeedCacheItem struct {
|
|||
Value []byte `json:"value"`
|
||||
TTL time.Time `json:"ttl"`
|
||||
}
|
||||
|
||||
type FindOneParams struct {
|
||||
FeedID int
|
||||
IndexerID int
|
||||
IndexerIdentifier string
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@ type Indexer struct {
|
|||
Settings map[string]string `json:"settings,omitempty"`
|
||||
}
|
||||
|
||||
func (i Indexer) ImplementationIsFeed() bool {
|
||||
return i.Implementation == "rss" || i.Implementation == "torznab" || i.Implementation == "newznab"
|
||||
}
|
||||
|
||||
type IndexerMinimal struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue