sharedsettings

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sharedsettings manages the single-row shared_media_handling table. These are filesystem/handling settings that apply uniformly across all media-manager services (Prism, Pilot). Services pull them via their sync loops and overwrite the corresponding fields in their own local settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service manages the shared settings record.

func NewService

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

NewService constructs a new shared settings service.

func (*Service) Get

func (s *Service) Get(ctx context.Context) (*Settings, error)

Get returns the current shared settings. The row always exists (inserted by the migration), so this is a pure read.

func (*Service) Update

func (s *Service) Update(ctx context.Context, input Settings) (*Settings, error)

Update overwrites the settings and publishes an update event.

type Settings

type Settings struct {
	ColonReplacement    string `json:"colon_replacement"`
	ImportExtraFiles    bool   `json:"import_extra_files"`
	ExtraFileExtensions string `json:"extra_file_extensions"`
	RenameFiles         bool   `json:"rename_files"`
	UpdatedAt           string `json:"updated_at"`
}

Settings is the data shape exposed externally. Matches the DB columns 1:1 minus the sentinel `id` (always 1).

Jump to

Keyboard shortcuts

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