blocklist

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package blocklist manages the release blocklist used to skip known-bad releases.

Index

Constants

This section is empty.

Variables

View Source
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 NewService

func NewService(q dbgen.Querier) *Service

NewService creates a new Service.

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) Clear

func (s *Service) Clear(ctx context.Context) error

Clear removes all blocklist entries.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, id string) error

Delete removes a single blocklist entry by ID.

func (*Service) IsBlocklisted

func (s *Service) IsBlocklisted(ctx context.Context, releaseGUID string) (bool, error)

IsBlocklisted reports whether a release GUID is on the blocklist.

func (*Service) IsBlocklistedByTitle

func (s *Service) IsBlocklistedByTitle(ctx context.Context, releaseTitle string) (bool, error)

IsBlocklistedByTitle reports whether a release title is on the blocklist. Used when the grab GUID is not available (e.g. blocklisting from the queue).

func (*Service) List

func (s *Service) List(ctx context.Context, page, perPage int) ([]Entry, int64, error)

List returns a paginated list of blocklist entries, newest first.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL