Documentation
¶
Overview ¶
Package blocklist manages the release blocklist used to skip known-bad releases.
Index ¶
- Variables
- type Entry
- type Service
- func (s *Service) Add(ctx context.Context, ...) error
- func (s *Service) Clear(ctx context.Context) error
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) IsBlocklisted(ctx context.Context, releaseGUID string) (bool, error)
- func (s *Service) IsBlocklistedByTitle(ctx context.Context, releaseTitle string) (bool, error)
- func (s *Service) List(ctx context.Context, page, perPage int) ([]Entry, int64, error)
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyBlocklisted = errors.New("release already blocklisted")
ErrAlreadyBlocklisted is returned when adding a GUID that is already on the blocklist.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
ID string
MovieID string
MovieTitle string
ReleaseGUID string
ReleaseTitle string
IndexerID string
Protocol string
Size int64
AddedAt time.Time
Notes string
}
Entry is the domain representation of a blocklist record.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages the release blocklist.
func (*Service) Add ¶
func (s *Service) Add(ctx context.Context, movieID, releaseGUID, releaseTitle, indexerID, protocol string, size int64, notes string) error
Add inserts a new blocklist entry. Returns ErrAlreadyBlocklisted if the GUID is already present (the unique index on release_guid enforces this).
func (*Service) IsBlocklisted ¶
IsBlocklisted reports whether a release GUID is on the blocklist.
func (*Service) IsBlocklistedByTitle ¶
IsBlocklistedByTitle reports whether a release title is on the blocklist. Used when the grab GUID is not available (e.g. blocklisting from the queue).