Documentation
¶
Index ¶
- func CookiePath(dbPath, fileName string) (string, error)
- func DefaultPath() (string, error)
- func FileInSubdir(dbPath, dirName, fileName string) (string, error)
- func IsBusyError(err error) bool
- func Migrate(db *sql.DB) error
- func MigrateContext(ctx context.Context, db *sql.DB) error
- func RootDir(dbPath string) (string, error)
- func Subdir(dbPath, name string) (string, error)
- type DVDMediaInfo
- type DescriptionOverride
- type ExternalIDs
- type ExternalMetadata
- type FileMetadata
- type HistoryEntry
- type HistoryOverview
- type IMDBMetadata
- type Logger
- type MetadataRepository
- type PlaylistInfo
- type PlaylistItem
- type PlaylistSelection
- type ReleaseNameOverrides
- type SQLiteRepository
- func Open(path string) (*SQLiteRepository, error)
- func OpenContext(ctx context.Context, path string) (*SQLiteRepository, error)
- func OpenWithLogger(path string, logger Logger) (*SQLiteRepository, error)
- func OpenWithLoggerContext(ctx context.Context, path string, logger Logger) (*SQLiteRepository, error)
- func (r *SQLiteRepository) Close() error
- func (r *SQLiteRepository) ConfigSectionLastUpdated(ctx context.Context, section string) (time.Time, error)
- func (r *SQLiteRepository) CreateUploadRecord(ctx context.Context, record UploadRecord) error
- func (r *SQLiteRepository) DBPath() string
- func (r *SQLiteRepository) DeleteDescriptionOverride(ctx context.Context, path string, groupKey string) error
- func (r *SQLiteRepository) DeleteFinalSelection(ctx context.Context, imagePath string) error
- func (r *SQLiteRepository) DeletePlaylistSelection(ctx context.Context, sourcePath string) error
- func (r *SQLiteRepository) DeleteReleaseNameOverrides(ctx context.Context, path string) error
- func (r *SQLiteRepository) DeleteScreenshot(ctx context.Context, imagePath string) error
- func (r *SQLiteRepository) DeleteUploadedImage(ctx context.Context, path string, imagePath string, host string) error
- func (r *SQLiteRepository) GetByPath(ctx context.Context, path string) (FileMetadata, error)
- func (r *SQLiteRepository) GetDVDMediaInfo(ctx context.Context, path string) (DVDMediaInfo, error)
- func (r *SQLiteRepository) GetDescriptionOverride(ctx context.Context, path string, groupKey string) (DescriptionOverride, error)
- func (r *SQLiteRepository) GetExternalIDs(ctx context.Context, path string) (ExternalIDs, error)
- func (r *SQLiteRepository) GetExternalMetadata(ctx context.Context, path string) (ExternalMetadata, error)
- func (r *SQLiteRepository) GetPlaylistSelection(ctx context.Context, sourcePath string) (PlaylistSelection, error)
- func (r *SQLiteRepository) GetReleaseNameOverrides(ctx context.Context, path string) (ReleaseNameOverrides, error)
- func (r *SQLiteRepository) GetTrackerTimestamp(ctx context.Context, tracker string) (time.Time, error)
- func (r *SQLiteRepository) ListDescriptionOverridesByPath(ctx context.Context, path string) ([]DescriptionOverride, error)
- func (r *SQLiteRepository) ListFinalSelections(ctx context.Context, path string) ([]ScreenshotFinalSelection, error)
- func (r *SQLiteRepository) ListHistoryEntries(ctx context.Context) ([]HistoryEntry, error)
- func (r *SQLiteRepository) ListPendingUploads(ctx context.Context) ([]UploadRecord, error)
- func (r *SQLiteRepository) ListScreenshotSlotsByPath(ctx context.Context, path string) ([]ScreenshotSlot, error)
- func (r *SQLiteRepository) ListScreenshotsByPath(ctx context.Context, path string) ([]Screenshot, error)
- func (r *SQLiteRepository) ListStoredReleasePaths(ctx context.Context) ([]string, error)
- func (r *SQLiteRepository) ListTrackerMetadataByPath(ctx context.Context, path string) ([]TrackerMetadata, error)
- func (r *SQLiteRepository) ListTrackerRuleFailuresByPath(ctx context.Context, path string) ([]TrackerRuleFailure, error)
- func (r *SQLiteRepository) ListUploadHistoryByPath(ctx context.Context, sourcePath string) ([]UploadRecord, error)
- func (r *SQLiteRepository) ListUploadedImagesByPath(ctx context.Context, path string) ([]UploadedImageLink, error)
- func (r *SQLiteRepository) LoadConfigSection(ctx context.Context, section string, dest any) error
- func (r *SQLiteRepository) LoadFullConfig(ctx context.Context, dest any) error
- func (r *SQLiteRepository) Migrate() error
- func (r *SQLiteRepository) MigrateContext(ctx context.Context) error
- func (r *SQLiteRepository) PurgeContentData(ctx context.Context, path string) error
- func (r *SQLiteRepository) RawDB() *sql.DB
- func (r *SQLiteRepository) ReplaceScreenshotSlots(ctx context.Context, path string, slots []ScreenshotSlot) error
- func (r *SQLiteRepository) Save(ctx context.Context, metadata FileMetadata) error
- func (r *SQLiteRepository) SaveConfigSection(ctx context.Context, section string, data any) error
- func (r *SQLiteRepository) SaveConfigSections(ctx context.Context, sections map[string]any) error
- func (r *SQLiteRepository) SaveDVDMediaInfo(ctx context.Context, info DVDMediaInfo) error
- func (r *SQLiteRepository) SaveDescriptionOverride(ctx context.Context, override DescriptionOverride) error
- func (r *SQLiteRepository) SaveExternalIDs(ctx context.Context, ids ExternalIDs) error
- func (r *SQLiteRepository) SaveExternalMetadata(ctx context.Context, metadata ExternalMetadata) error
- func (r *SQLiteRepository) SaveFinalSelections(ctx context.Context, path string, selections []ScreenshotFinalSelection) error
- func (r *SQLiteRepository) SaveFullConfig(ctx context.Context, cfg any) error
- func (r *SQLiteRepository) SaveFullConfigWithPreSave(ctx context.Context, cfg any, preSave func(context.Context, *sql.Tx) error) error
- func (r *SQLiteRepository) SavePlaylistSelection(ctx context.Context, sourcePath string, playlists []string, useAll bool) error
- func (r *SQLiteRepository) SaveReleaseNameOverrides(ctx context.Context, path string, overrides ReleaseNameOverrides) error
- func (r *SQLiteRepository) SaveScreenshot(ctx context.Context, screenshot Screenshot) error
- func (r *SQLiteRepository) SaveTrackerMetadata(ctx context.Context, metadata TrackerMetadata) error
- func (r *SQLiteRepository) SaveTrackerRuleFailures(ctx context.Context, sourcePath string, tracker string, ...) error
- func (r *SQLiteRepository) SaveTrackerTimestamp(ctx context.Context, timestamp TrackerTimestamp) error
- func (r *SQLiteRepository) SaveUploadedImages(ctx context.Context, path string, host string, images []UploadedImageLink) error
- func (r *SQLiteRepository) UpdateLatestUploadRecordStatus(ctx context.Context, sourcePath string, tracker string, status string) error
- func (r *SQLiteRepository) UpsertScreenshotSlotVariants(ctx context.Context, path string, variants []ScreenshotSlotVariant) error
- type Screenshot
- type ScreenshotFinalSelection
- type ScreenshotPurpose
- type ScreenshotSlot
- type ScreenshotSlotVariant
- type TMDBMetadata
- type TVDBMetadata
- type TVmazeMetadata
- type TrackerMetadata
- type TrackerRuleFailure
- type TrackerTimestamp
- type UploadRecord
- type UploadedImageLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookiePath ¶
func DefaultPath ¶
func FileInSubdir ¶
func IsBusyError ¶
Types ¶
type DVDMediaInfo ¶
type DVDMediaInfo = api.DVDMediaInfo
type DescriptionOverride ¶
type DescriptionOverride = api.DescriptionOverride
type ExternalIDs ¶
type ExternalIDs = api.ExternalIDs
type ExternalMetadata ¶
type ExternalMetadata = api.ExternalMetadata
type FileMetadata ¶
type FileMetadata = api.FileMetadata
type HistoryEntry ¶
type HistoryEntry = api.HistoryEntry
type HistoryOverview ¶
type HistoryOverview = api.HistoryOverview
type IMDBMetadata ¶
type IMDBMetadata = api.IMDBMetadata
type MetadataRepository ¶
type MetadataRepository = api.MetadataRepository
type PlaylistInfo ¶
type PlaylistInfo = api.PlaylistInfo
type PlaylistItem ¶
type PlaylistItem = api.PlaylistItem
type PlaylistSelection ¶
type PlaylistSelection = api.PlaylistSelection
type ReleaseNameOverrides ¶
type ReleaseNameOverrides = api.ReleaseNameOverrides
type SQLiteRepository ¶
type SQLiteRepository struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(path string) (*SQLiteRepository, error)
func OpenContext ¶
func OpenContext(ctx context.Context, path string) (*SQLiteRepository, error)
func OpenWithLogger ¶
func OpenWithLogger(path string, logger Logger) (*SQLiteRepository, error)
func OpenWithLoggerContext ¶
func (*SQLiteRepository) Close ¶
func (r *SQLiteRepository) Close() error
func (*SQLiteRepository) ConfigSectionLastUpdated ¶
func (r *SQLiteRepository) ConfigSectionLastUpdated(ctx context.Context, section string) (time.Time, error)
ConfigSectionLastUpdated returns the last update time for a config section.
func (*SQLiteRepository) CreateUploadRecord ¶
func (r *SQLiteRepository) CreateUploadRecord(ctx context.Context, record UploadRecord) error
func (*SQLiteRepository) DBPath ¶ added in v0.2.0
func (r *SQLiteRepository) DBPath() string
DBPath returns the resolved on-disk database path when the repository was opened from a normal filesystem path. It returns empty for SQLite sentinel or URI inputs so callers do not invent helper-file locations for in-memory DBs or opaque SQLite connection strings.
func (*SQLiteRepository) DeleteDescriptionOverride ¶
func (*SQLiteRepository) DeleteFinalSelection ¶
func (r *SQLiteRepository) DeleteFinalSelection(ctx context.Context, imagePath string) error
func (*SQLiteRepository) DeletePlaylistSelection ¶
func (r *SQLiteRepository) DeletePlaylistSelection(ctx context.Context, sourcePath string) error
func (*SQLiteRepository) DeleteReleaseNameOverrides ¶
func (r *SQLiteRepository) DeleteReleaseNameOverrides(ctx context.Context, path string) error
func (*SQLiteRepository) DeleteScreenshot ¶
func (r *SQLiteRepository) DeleteScreenshot(ctx context.Context, imagePath string) error
func (*SQLiteRepository) DeleteUploadedImage ¶
func (*SQLiteRepository) GetByPath ¶
func (r *SQLiteRepository) GetByPath(ctx context.Context, path string) (FileMetadata, error)
func (*SQLiteRepository) GetDVDMediaInfo ¶
func (r *SQLiteRepository) GetDVDMediaInfo(ctx context.Context, path string) (DVDMediaInfo, error)
func (*SQLiteRepository) GetDescriptionOverride ¶
func (r *SQLiteRepository) GetDescriptionOverride(ctx context.Context, path string, groupKey string) (DescriptionOverride, error)
func (*SQLiteRepository) GetExternalIDs ¶
func (r *SQLiteRepository) GetExternalIDs(ctx context.Context, path string) (ExternalIDs, error)
func (*SQLiteRepository) GetExternalMetadata ¶
func (r *SQLiteRepository) GetExternalMetadata(ctx context.Context, path string) (ExternalMetadata, error)
func (*SQLiteRepository) GetPlaylistSelection ¶
func (r *SQLiteRepository) GetPlaylistSelection(ctx context.Context, sourcePath string) (PlaylistSelection, error)
func (*SQLiteRepository) GetReleaseNameOverrides ¶
func (r *SQLiteRepository) GetReleaseNameOverrides(ctx context.Context, path string) (ReleaseNameOverrides, error)
func (*SQLiteRepository) GetTrackerTimestamp ¶
func (*SQLiteRepository) ListDescriptionOverridesByPath ¶
func (r *SQLiteRepository) ListDescriptionOverridesByPath(ctx context.Context, path string) ([]DescriptionOverride, error)
func (*SQLiteRepository) ListFinalSelections ¶
func (r *SQLiteRepository) ListFinalSelections(ctx context.Context, path string) ([]ScreenshotFinalSelection, error)
func (*SQLiteRepository) ListHistoryEntries ¶
func (r *SQLiteRepository) ListHistoryEntries(ctx context.Context) ([]HistoryEntry, error)
func (*SQLiteRepository) ListPendingUploads ¶
func (r *SQLiteRepository) ListPendingUploads(ctx context.Context) ([]UploadRecord, error)
func (*SQLiteRepository) ListScreenshotSlotsByPath ¶
func (r *SQLiteRepository) ListScreenshotSlotsByPath(ctx context.Context, path string) ([]ScreenshotSlot, error)
func (*SQLiteRepository) ListScreenshotsByPath ¶
func (r *SQLiteRepository) ListScreenshotsByPath(ctx context.Context, path string) ([]Screenshot, error)
func (*SQLiteRepository) ListStoredReleasePaths ¶
func (r *SQLiteRepository) ListStoredReleasePaths(ctx context.Context) ([]string, error)
func (*SQLiteRepository) ListTrackerMetadataByPath ¶
func (r *SQLiteRepository) ListTrackerMetadataByPath(ctx context.Context, path string) ([]TrackerMetadata, error)
func (*SQLiteRepository) ListTrackerRuleFailuresByPath ¶
func (r *SQLiteRepository) ListTrackerRuleFailuresByPath(ctx context.Context, path string) ([]TrackerRuleFailure, error)
func (*SQLiteRepository) ListUploadHistoryByPath ¶
func (r *SQLiteRepository) ListUploadHistoryByPath(ctx context.Context, sourcePath string) ([]UploadRecord, error)
func (*SQLiteRepository) ListUploadedImagesByPath ¶
func (r *SQLiteRepository) ListUploadedImagesByPath(ctx context.Context, path string) ([]UploadedImageLink, error)
func (*SQLiteRepository) LoadConfigSection ¶
LoadConfigSection retrieves a single config section from the database.
func (*SQLiteRepository) LoadFullConfig ¶
func (r *SQLiteRepository) LoadFullConfig(ctx context.Context, dest any) error
LoadFullConfig reconstructs the entire config from all sections. Each raw section is rejected if it contains duplicate JSON object names before the sections are joined, so malformed stored data cannot collapse duplicate keys during unmarshaling.
func (*SQLiteRepository) Migrate ¶
func (r *SQLiteRepository) Migrate() error
func (*SQLiteRepository) MigrateContext ¶
func (r *SQLiteRepository) MigrateContext(ctx context.Context) error
func (*SQLiteRepository) PurgeContentData ¶
func (r *SQLiteRepository) PurgeContentData(ctx context.Context, path string) error
func (*SQLiteRepository) RawDB ¶
func (r *SQLiteRepository) RawDB() *sql.DB
RawDB returns the underlying *sql.DB handle.
Callers using RawDB bypass repository safeguards such as validation, busy-retry behavior, and repository-level error wrapping. Restrict usage to approved low-level paths (for example migrations, tests, or advanced operations that are not exposed through repository methods), and avoid casual direct query/exec calls in application code.
func (*SQLiteRepository) ReplaceScreenshotSlots ¶
func (r *SQLiteRepository) ReplaceScreenshotSlots(ctx context.Context, path string, slots []ScreenshotSlot) error
func (*SQLiteRepository) Save ¶
func (r *SQLiteRepository) Save(ctx context.Context, metadata FileMetadata) error
func (*SQLiteRepository) SaveConfigSection ¶
SaveConfigSection persists a single config section as JSON.
func (*SQLiteRepository) SaveConfigSections ¶ added in v0.2.0
SaveConfigSections persists multiple prepared config sections in one transaction. The map keys are config root section names and values are marshaled before the transaction starts; if any section write fails, no selected section is committed.
func (*SQLiteRepository) SaveDVDMediaInfo ¶
func (r *SQLiteRepository) SaveDVDMediaInfo(ctx context.Context, info DVDMediaInfo) error
func (*SQLiteRepository) SaveDescriptionOverride ¶
func (r *SQLiteRepository) SaveDescriptionOverride(ctx context.Context, override DescriptionOverride) error
func (*SQLiteRepository) SaveExternalIDs ¶
func (r *SQLiteRepository) SaveExternalIDs(ctx context.Context, ids ExternalIDs) error
func (*SQLiteRepository) SaveExternalMetadata ¶
func (r *SQLiteRepository) SaveExternalMetadata(ctx context.Context, metadata ExternalMetadata) error
func (*SQLiteRepository) SaveFinalSelections ¶
func (r *SQLiteRepository) SaveFinalSelections(ctx context.Context, path string, selections []ScreenshotFinalSelection) error
func (*SQLiteRepository) SaveFullConfig ¶
func (r *SQLiteRepository) SaveFullConfig(ctx context.Context, cfg any) error
SaveFullConfig persists the entire config to all sections. This is called when exporting to database from YAML or UI updates.
func (*SQLiteRepository) SaveFullConfigWithPreSave ¶ added in v0.2.0
func (r *SQLiteRepository) SaveFullConfigWithPreSave(ctx context.Context, cfg any, preSave func(context.Context, *sql.Tx) error) error
SaveFullConfigWithPreSave persists the entire config and runs preSave in the same write transaction immediately before config sections are written. If preSave or any section write fails, the transaction is rolled back.
func (*SQLiteRepository) SavePlaylistSelection ¶
func (*SQLiteRepository) SaveReleaseNameOverrides ¶
func (r *SQLiteRepository) SaveReleaseNameOverrides(ctx context.Context, path string, overrides ReleaseNameOverrides) error
func (*SQLiteRepository) SaveScreenshot ¶
func (r *SQLiteRepository) SaveScreenshot(ctx context.Context, screenshot Screenshot) error
func (*SQLiteRepository) SaveTrackerMetadata ¶
func (r *SQLiteRepository) SaveTrackerMetadata(ctx context.Context, metadata TrackerMetadata) error
func (*SQLiteRepository) SaveTrackerRuleFailures ¶
func (r *SQLiteRepository) SaveTrackerRuleFailures(ctx context.Context, sourcePath string, tracker string, failures []TrackerRuleFailure) error
func (*SQLiteRepository) SaveTrackerTimestamp ¶
func (r *SQLiteRepository) SaveTrackerTimestamp(ctx context.Context, timestamp TrackerTimestamp) error
func (*SQLiteRepository) SaveUploadedImages ¶
func (r *SQLiteRepository) SaveUploadedImages(ctx context.Context, path string, host string, images []UploadedImageLink) error
func (*SQLiteRepository) UpdateLatestUploadRecordStatus ¶
func (*SQLiteRepository) UpsertScreenshotSlotVariants ¶
func (r *SQLiteRepository) UpsertScreenshotSlotVariants(ctx context.Context, path string, variants []ScreenshotSlotVariant) error
type Screenshot ¶
type Screenshot = api.Screenshot
type ScreenshotFinalSelection ¶
type ScreenshotFinalSelection = api.ScreenshotFinalSelection
type ScreenshotPurpose ¶
type ScreenshotPurpose = api.ScreenshotPurpose
type ScreenshotSlot ¶
type ScreenshotSlot = api.ScreenshotSlot
type ScreenshotSlotVariant ¶
type ScreenshotSlotVariant = api.ScreenshotSlotVariant
type TMDBMetadata ¶
type TMDBMetadata = api.TMDBMetadata
type TVDBMetadata ¶
type TVDBMetadata = api.TVDBMetadata
type TVmazeMetadata ¶
type TVmazeMetadata = api.TVmazeMetadata
type TrackerMetadata ¶
type TrackerMetadata = api.TrackerMetadata
type TrackerRuleFailure ¶
type TrackerRuleFailure = api.TrackerRuleFailure
type TrackerTimestamp ¶
type TrackerTimestamp = api.TrackerTimestamp
type UploadRecord ¶
type UploadRecord = api.UploadRecord
type UploadedImageLink ¶
type UploadedImageLink = api.UploadedImageLink