qualityprofile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package qualityprofile manages centralized quality profiles that are distributed to media-manager services (Prism, Pilot) via their sync loops.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("quality profile not found")

ErrNotFound is returned when a quality profile does not exist.

Functions

This section is empty.

Types

type Input

type Input struct {
	Name                 string  `json:"name"`
	CutoffJSON           string  `json:"cutoff_json"`
	QualitiesJSON        string  `json:"qualities_json"`
	UpgradeAllowed       bool    `json:"upgrade_allowed"`
	UpgradeUntilJSON     *string `json:"upgrade_until_json,omitempty"`
	MinCustomFormatScore int     `json:"min_custom_format_score"`
	UpgradeUntilCFScore  int     `json:"upgrade_until_cf_score"`
}

Input is the data needed to create or update a quality profile. The JSON fields (CutoffJSON, QualitiesJSON, UpgradeUntilJSON) are passed through verbatim to consumers — Pulse does not interpret their contents.

type Service

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

Service manages quality profile records.

func NewService

func NewService(q db.Querier, bus *events.Bus, logger *slog.Logger) *Service

NewService creates a new quality profile service.

func (*Service) Create

func (s *Service) Create(ctx context.Context, input Input) (*db.QualityProfile, error)

Create adds a new quality profile.

func (*Service) Delete

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

Delete removes a quality profile. Pulse does not have foreign-key references to quality profiles (services hold those), so deletion always succeeds at the Pulse level. Services will remove their local copies on the next sync.

func (*Service) Get

func (s *Service) Get(ctx context.Context, id string) (*db.QualityProfile, error)

Get returns a single quality profile by ID.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]db.QualityProfile, error)

List returns all quality profiles, sorted by name.

func (*Service) SeedDefaults

func (s *Service) SeedDefaults(ctx context.Context, cfg *cfgstore.Store) error

SeedDefaults inserts a baseline set of quality profiles on first run so new users are never confronted with an empty dropdown when creating their first library in Prism or Pilot. Seeding is one-shot: once the marker is set, future restarts leave existing profiles alone, even if the user has deleted all of them.

Seeded profiles are normal, fully editable Pulse profiles — the user can rename, adjust, or delete any of them, and advanced users can replace them wholesale via the TRaSH Guides integration when that lands.

func (*Service) Update

func (s *Service) Update(ctx context.Context, id string, input Input) (*db.QualityProfile, error)

Update modifies an existing quality profile.

Jump to

Keyboard shortcuts

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