Documentation
¶
Overview ¶
Package qualityprofile manages centralized quality profiles that are distributed to media-manager services (Prism, Pilot) via their sync loops.
Index ¶
- Variables
- type Input
- type Service
- func (s *Service) Create(ctx context.Context, input Input) (*db.QualityProfile, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) Get(ctx context.Context, id string) (*db.QualityProfile, error)
- func (s *Service) List(ctx context.Context) ([]db.QualityProfile, error)
- func (s *Service) SeedDefaults(ctx context.Context, cfg *cfgstore.Store) error
- func (s *Service) Update(ctx context.Context, id string, input Input) (*db.QualityProfile, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewService creates a new quality profile service.
func (*Service) Delete ¶
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) SeedDefaults ¶
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.