seriesbulk

package
v0.1.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: 8 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 seriesbulk edits or deletes many series at once (Sonarr's mass editor). Every change is validated as a whole first and then applied in one transaction, so a request either changes every series or none.

Index

Constants

View Source
const MaxSeries = 1000

MaxSeries caps one request.

Variables

View Source
var SeriesTypes = map[string]bool{"standard": true, "anime": true, "daily": true}

SeriesTypes are the valid series types.

Functions

This section is empty.

Types

type Edit

type Edit struct {
	IDs              []string
	Monitored        *bool
	QualityProfileID *string
	LibraryID        *string
	SeriesType       *string
}

Edit changes the given fields of every series in IDs. A nil field is left as it is.

type Publisher

type Publisher interface {
	Publish(ctx context.Context, e events.Event)
}

Publisher announces deleted series.

type Recycler

type Recycler interface {
	Delete(ctx context.Context, path, libraryRoot string) (string, error)
}

Recycler removes a file, into the recycle bin when one is set.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service applies bulk changes.

func New

func New(sqlDB *sql.DB, recycle Recycler, bus Publisher, logger *slog.Logger) *Service

New creates a Service. recycle and bus may be nil.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, ids []string, deleteFiles bool) (int, error)

Delete removes every series in ids. With deleteFiles, their recorded episode files are removed from disk too, through the recycle bin when one is set. The database change is one transaction; files are removed after it commits, and a file that can't be removed is logged, not returned (the series is already gone).

func (*Service) Edit

func (s *Service) Edit(ctx context.Context, e Edit) (int, error)

Edit applies e to every series. It returns how many series changed.

type ValidationError

type ValidationError struct{ Msg string }

ValidationError explains why a request was rejected. Nothing changed.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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