Documentation
¶
Index ¶
- Constants
- type CatalogSearchLimits
- type CatalogSearchWarning
- type RuntimePragmas
- type SQLiteOptions
- type Store
- func (s *Store) AddFavorite(ctx context.Context, itemKey string, startGuideNumber int) (favorites.Favorite, error)
- func (s *Store) AddSource(ctx context.Context, channelID int64, itemKey string, allowCrossChannel bool) (channels.Source, error)
- func (s *Store) BulkUpdatePlaylistSources(ctx context.Context, updates []playlist.PlaylistSourceBulkUpdate) error
- func (s *Store) CatalogSearchWarningForQuery(search string, searchRegex bool) (CatalogSearchWarning, error)
- func (s *Store) ClearAllSourceHealth(ctx context.Context) (int64, error)
- func (s *Store) ClearSourceHealth(ctx context.Context, channelID int64) (int64, error)
- func (s *Store) Close() error
- func (s *Store) CreateChannelFromItem(ctx context.Context, itemKey, guideName, channelKey string, ...) (channels.Channel, error)
- func (s *Store) CreateDynamicChannelQuery(ctx context.Context, create channels.DynamicChannelQueryCreate) (channels.DynamicChannelQuery, error)
- func (s *Store) CreatePlaylistSource(ctx context.Context, create playlist.PlaylistSourceCreate) (playlist.PlaylistSource, error)
- func (s *Store) CreateRun(ctx context.Context, jobName, triggeredBy string, startedAt int64) (int64, error)
- func (s *Store) DeleteAllStreamMetrics(ctx context.Context) (int64, error)
- func (s *Store) DeleteChannel(ctx context.Context, channelID int64, startGuideNumber int) error
- func (s *Store) DeleteChannelDVRMapping(ctx context.Context, dvrInstanceID, channelID int64) error
- func (s *Store) DeleteDynamicChannelQuery(ctx context.Context, queryID int64) error
- func (s *Store) DeletePlaylistSource(ctx context.Context, sourceID int64) error
- func (s *Store) DeleteSource(ctx context.Context, channelID, sourceID int64) error
- func (s *Store) FinishRun(ctx context.Context, runID int64, status, errText, summary string, ...) error
- func (s *Store) GetChannelByGuideNumber(ctx context.Context, guideNumber string) (channels.Channel, error)
- func (s *Store) GetChannelDVRMapping(ctx context.Context, dvrInstanceID, channelID int64) (dvr.ChannelMapping, error)
- func (s *Store) GetDVRInstance(ctx context.Context) (dvr.InstanceConfig, error)
- func (s *Store) GetDynamicChannelQuery(ctx context.Context, queryID int64) (channels.DynamicChannelQuery, error)
- func (s *Store) GetGroups(ctx context.Context) ([]playlist.Group, error)
- func (s *Store) GetPlaylistSource(ctx context.Context, sourceID int64) (playlist.PlaylistSource, error)
- func (s *Store) GetRun(ctx context.Context, runID int64) (jobs.Run, error)
- func (s *Store) GetSetting(ctx context.Context, key string) (string, error)
- func (s *Store) GetSource(ctx context.Context, channelID, sourceID int64, enabledOnly bool) (channels.Source, error)
- func (s *Store) GetStreamMetric(ctx context.Context, itemKey string) (jobs.StreamMetric, error)
- func (s *Store) IterateActiveItemKeysByCatalogFilter(ctx context.Context, groupNames []string, searchQuery string, searchRegex bool, ...) (int, error)
- func (s *Store) IterateActiveItemKeysByCatalogFilterBySourceIDs(ctx context.Context, sourceIDs []int64, groupNames []string, ...) (int, error)
- func (s *Store) ListActiveGroupNamesBySourceIDs(ctx context.Context, sourceIDs []int64) ([]string, error)
- func (s *Store) ListActiveItemKeysByCatalogFilter(ctx context.Context, groupNames []string, searchQuery string, searchRegex bool) ([]string, error)
- func (s *Store) ListActiveItemKeysByCatalogFilterBySourceIDs(ctx context.Context, sourceIDs []int64, groupNames []string, ...) ([]string, error)
- func (s *Store) ListActiveItemKeysByChannelKey(ctx context.Context, channelKey string) ([]string, error)
- func (s *Store) ListCatalogItems(ctx context.Context, q playlist.Query) ([]playlist.Item, int, error)
- func (s *Store) ListChannels(ctx context.Context, enabledOnly bool) ([]channels.Channel, error)
- func (s *Store) ListChannelsForDVRSync(ctx context.Context, dvrInstanceID int64, enabledOnly bool, ...) ([]dvr.ChannelMapping, error)
- func (s *Store) ListChannelsForDVRSyncPaged(ctx context.Context, dvrInstanceID int64, enabledOnly bool, ...) ([]dvr.ChannelMapping, int, error)
- func (s *Store) ListChannelsPaged(ctx context.Context, enabledOnly bool, limit, offset int) ([]channels.Channel, int, error)
- func (s *Store) ListDuplicateSuggestions(ctx context.Context, minItems int, searchQuery string, limit, offset int) ([]channels.DuplicateGroup, int, error)
- func (s *Store) ListDynamicChannelQueries(ctx context.Context) ([]channels.DynamicChannelQuery, error)
- func (s *Store) ListDynamicChannelQueriesPaged(ctx context.Context, limit, offset int) ([]channels.DynamicChannelQuery, int, error)
- func (s *Store) ListDynamicGeneratedChannelsPaged(ctx context.Context, queryID int64, limit, offset int) ([]channels.Channel, int, error)
- func (s *Store) ListFavorites(ctx context.Context, enabledOnly bool) ([]favorites.Favorite, error)
- func (s *Store) ListGroupsPaged(ctx context.Context, limit, offset int, includeCounts bool) ([]playlist.Group, int, error)
- func (s *Store) ListGroupsPagedBySourceIDs(ctx context.Context, sourceIDs []int64, limit, offset int, includeCounts bool) ([]playlist.Group, int, error)
- func (s *Store) ListItems(ctx context.Context, q playlist.Query) ([]playlist.Item, int, error)
- func (s *Store) ListLineupChannels(ctx context.Context) ([]channels.Channel, error)
- func (s *Store) ListPlaylistSources(ctx context.Context) ([]playlist.PlaylistSource, error)
- func (s *Store) ListRuns(ctx context.Context, jobName string, limit, offset int) ([]jobs.Run, error)
- func (s *Store) ListSettings(ctx context.Context, keyPrefix string) (map[string]string, error)
- func (s *Store) ListSources(ctx context.Context, channelID int64, enabledOnly bool) ([]channels.Source, error)
- func (s *Store) ListSourcesByChannelIDs(ctx context.Context, channelIDs []int64, enabledOnly bool) (map[int64][]channels.Source, error)
- func (s *Store) ListSourcesPaged(ctx context.Context, channelID int64, enabledOnly bool, limit, offset int) ([]channels.Source, int, error)
- func (s *Store) MarkSourceFailure(ctx context.Context, sourceID int64, reason string, failedAt time.Time) error
- func (s *Store) MarkSourceSuccess(ctx context.Context, sourceID int64, succeededAt time.Time) error
- func (s *Store) RefreshDynamicGeneratedGuideNames(ctx context.Context) (int, error)
- func (s *Store) RemoveFavorite(ctx context.Context, favID int64, startGuideNumber int) error
- func (s *Store) ReorderChannels(ctx context.Context, channelIDs []int64, startGuideNumber int) error
- func (s *Store) ReorderDynamicGeneratedChannels(ctx context.Context, queryID int64, channelIDs []int64) error
- func (s *Store) ReorderFavorites(ctx context.Context, favIDs []int64, startGuideNumber int) error
- func (s *Store) ReorderSources(ctx context.Context, channelID int64, sourceIDs []int64) error
- func (s *Store) RuntimePragmas(ctx context.Context) (RuntimePragmas, error)
- func (s *Store) SetSetting(ctx context.Context, key, value string) error
- func (s *Store) SetSettings(ctx context.Context, values map[string]string) error
- func (s *Store) SupportsSourceScopedDynamicChannelBlocks() bool
- func (s *Store) SyncDynamicChannelBlocks(ctx context.Context) (channels.DynamicChannelSyncResult, error)
- func (s *Store) SyncDynamicSources(ctx context.Context, channelID int64, matchedItemKeys []string) (channels.DynamicSourceSyncResult, error)
- func (s *Store) SyncDynamicSourcesByCatalogFilter(ctx context.Context, channelID int64, sourceIDs []int64, groupNames []string, ...) (channels.DynamicSourceSyncResult, int, error)
- func (s *Store) UpdateChannel(ctx context.Context, channelID int64, guideName *string, enabled *bool, ...) (channels.Channel, error)
- func (s *Store) UpdateDynamicChannelQuery(ctx context.Context, queryID int64, update channels.DynamicChannelQueryUpdate) (channels.DynamicChannelQuery, error)
- func (s *Store) UpdatePlaylistSource(ctx context.Context, sourceID int64, update playlist.PlaylistSourceUpdate) (playlist.PlaylistSource, error)
- func (s *Store) UpdateRunProgress(ctx context.Context, runID int64, progressCur, progressMax int, summary string) error
- func (s *Store) UpdateSource(ctx context.Context, channelID, sourceID int64, enabled *bool) (channels.Source, error)
- func (s *Store) UpdateSourceProfile(ctx context.Context, sourceID int64, profile channels.SourceProfileUpdate) error
- func (s *Store) UpsertChannelDVRMapping(ctx context.Context, mapping dvr.ChannelMapping) (dvr.ChannelMapping, error)
- func (s *Store) UpsertDVRInstance(ctx context.Context, instance dvr.InstanceConfig) (dvr.InstanceConfig, error)
- func (s *Store) UpsertPlaylistItems(ctx context.Context, items []playlist.Item) error
- func (s *Store) UpsertPlaylistItemsForSource(ctx context.Context, sourceID int64, items []playlist.Item) error
- func (s *Store) UpsertPlaylistItemsStream(ctx context.Context, stream playlist.ItemStream) (int, error)
- func (s *Store) UpsertPlaylistItemsStreamForSource(ctx context.Context, sourceID int64, stream playlist.ItemStream) (int, error)
- func (s *Store) UpsertStreamMetric(ctx context.Context, metric jobs.StreamMetric) error
Constants ¶
const ( SettingIdentityFriendlyName = "identity.friendly_name" SettingIdentityDeviceID = "identity.device_id" SettingIdentityDeviceAuth = "identity.device_auth" SettingAppVersion = "app.version" SettingAppCommit = "app.commit" SettingAppBuildTime = "app.build_time" SettingPlaylistURL = "playlist.url" SettingJobsTimezone = "jobs.timezone" SettingJobsPlaylistSyncEnabled = "jobs.playlist_sync.enabled" SettingJobsPlaylistSyncCron = "jobs.playlist_sync.cron" SettingJobsAutoPrioritizeEnabled = "jobs.auto_prioritize.enabled" SettingJobsAutoPrioritizeCron = "jobs.auto_prioritize.cron" SettingJobsDVRLineupSyncEnabled = "jobs.dvr_lineup_sync.enabled" SettingJobsDVRLineupSyncCron = "jobs.dvr_lineup_sync.cron" SettingAnalyzerProbeTimeoutMS = "analyzer.probe.timeout_ms" SettingAnalyzerAnalyzeDurationUS = "analyzer.probe.analyzeduration_us" SettingAnalyzerProbeSizeBytes = "analyzer.probe.probesize_bytes" SettingAnalyzerBitrateMode = "analyzer.bitrate_mode" SettingAnalyzerSampleSeconds = "analyzer.sample_seconds" SettingAutoPrioritizeEnabledOnly = "analyzer.autoprioritize.enabled_only" SettingAutoPrioritizeTopNPerChannel = "analyzer.autoprioritize.top_n_per_channel" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatalogSearchLimits ¶
type CatalogSearchWarning ¶
type CatalogSearchWarning struct {
Mode string `json:"mode"`
Truncated bool `json:"truncated"`
MaxTerms int `json:"max_terms"`
MaxDisjuncts int `json:"max_disjuncts"`
MaxTermRunes int `json:"max_term_runes"`
TermsApplied int `json:"terms_applied"`
TermsDropped int `json:"terms_dropped"`
DisjunctsApplied int `json:"disjuncts_applied"`
DisjunctsDropped int `json:"disjuncts_dropped"`
TermRuneTruncationCount int `json:"term_rune_truncations"`
}
func CatalogSearchWarningForQuery ¶
func CatalogSearchWarningForQuery(search string, searchRegex bool, limits CatalogSearchLimits) (CatalogSearchWarning, error)
CatalogSearchWarningForQuery returns token/regex parse warnings for a catalog search expression using the provided limits. It is useful for response metadata and logging without rebuilding store query SQL.
type RuntimePragmas ¶
RuntimePragmas captures the active SQLite runtime tuning settings.
type SQLiteOptions ¶
type SQLiteOptions struct {
CatalogSearchLimits CatalogSearchLimits
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides SQLite-backed catalog persistence.
func OpenWithOptions ¶
func OpenWithOptions(dbPath string, options SQLiteOptions) (*Store, error)
func (*Store) AddFavorite ¶
func (*Store) BulkUpdatePlaylistSources ¶ added in v1.1.0
func (*Store) CatalogSearchWarningForQuery ¶
func (s *Store) CatalogSearchWarningForQuery(search string, searchRegex bool) (CatalogSearchWarning, error)
CatalogSearchWarningForQuery returns catalog-search truncation metadata for a query using the store's effective limits.
func (*Store) ClearAllSourceHealth ¶
func (*Store) ClearSourceHealth ¶
func (*Store) CreateChannelFromItem ¶
func (*Store) CreateDynamicChannelQuery ¶
func (s *Store) CreateDynamicChannelQuery(ctx context.Context, create channels.DynamicChannelQueryCreate) (channels.DynamicChannelQuery, error)
func (*Store) CreatePlaylistSource ¶ added in v1.1.0
func (s *Store) CreatePlaylistSource(ctx context.Context, create playlist.PlaylistSourceCreate) (playlist.PlaylistSource, error)
func (*Store) DeleteAllStreamMetrics ¶
DeleteAllStreamMetrics removes all cached stream analysis rows.
func (*Store) DeleteChannel ¶
func (*Store) DeleteChannelDVRMapping ¶
func (*Store) DeleteDynamicChannelQuery ¶
func (*Store) DeletePlaylistSource ¶ added in v1.1.0
func (*Store) DeleteSource ¶
func (*Store) GetChannelByGuideNumber ¶
func (*Store) GetChannelDVRMapping ¶
func (*Store) GetDVRInstance ¶
func (*Store) GetDynamicChannelQuery ¶
func (*Store) GetPlaylistSource ¶ added in v1.1.0
func (*Store) GetSetting ¶
GetSetting returns one setting value.
func (*Store) GetStreamMetric ¶
GetStreamMetric returns one cached stream analysis row by item key.
func (*Store) IterateActiveItemKeysByCatalogFilter ¶
func (s *Store) IterateActiveItemKeysByCatalogFilter( ctx context.Context, groupNames []string, searchQuery string, searchRegex bool, pageSize int, visit func(itemKey string) error, ) (int, error)
IterateActiveItemKeysByCatalogFilter iterates active catalog item keys matching the provided group+search filter in deterministic (name,item_key) order.
func (*Store) IterateActiveItemKeysByCatalogFilterBySourceIDs ¶ added in v1.1.0
func (s *Store) IterateActiveItemKeysByCatalogFilterBySourceIDs( ctx context.Context, sourceIDs []int64, groupNames []string, searchQuery string, searchRegex bool, pageSize int, visit func(itemKey string) error, ) (int, error)
IterateActiveItemKeysByCatalogFilterBySourceIDs iterates active catalog item keys matching the provided source+group+search filter in deterministic (name,item_key) order.
func (*Store) ListActiveGroupNamesBySourceIDs ¶ added in v1.1.0
func (*Store) ListActiveItemKeysByCatalogFilter ¶
func (s *Store) ListActiveItemKeysByCatalogFilter(ctx context.Context, groupNames []string, searchQuery string, searchRegex bool) ([]string, error)
ListActiveItemKeysByCatalogFilter returns active playlist item keys matching catalog group+search filters. Matching semantics intentionally mirror the /api/items query behavior.
func (*Store) ListActiveItemKeysByCatalogFilterBySourceIDs ¶ added in v1.1.0
func (s *Store) ListActiveItemKeysByCatalogFilterBySourceIDs(ctx context.Context, sourceIDs []int64, groupNames []string, searchQuery string, searchRegex bool) ([]string, error)
ListActiveItemKeysByCatalogFilterBySourceIDs returns active playlist item keys matching catalog source+group+search filters.
func (*Store) ListActiveItemKeysByChannelKey ¶
func (s *Store) ListActiveItemKeysByChannelKey(ctx context.Context, channelKey string) ([]string, error)
ListActiveItemKeysByChannelKey returns active playlist item keys for one channel_key.
func (*Store) ListCatalogItems ¶
func (s *Store) ListCatalogItems(ctx context.Context, q playlist.Query) ([]playlist.Item, int, error)
ListCatalogItems returns only the catalog list fields needed by /api/items.
func (*Store) ListChannels ¶
func (*Store) ListChannelsForDVRSync ¶
func (*Store) ListChannelsForDVRSyncPaged ¶
func (*Store) ListChannelsPaged ¶
func (*Store) ListDuplicateSuggestions ¶
func (*Store) ListDynamicChannelQueries ¶
func (*Store) ListDynamicChannelQueriesPaged ¶
func (*Store) ListDynamicGeneratedChannelsPaged ¶
func (*Store) ListFavorites ¶
func (*Store) ListGroupsPaged ¶
func (*Store) ListGroupsPagedBySourceIDs ¶ added in v1.1.0
func (s *Store) ListGroupsPagedBySourceIDs(ctx context.Context, sourceIDs []int64, limit, offset int, includeCounts bool) ([]playlist.Group, int, error)
ListGroupsPagedBySourceIDs returns paged active group names, optionally scoped to one or more playlist source IDs.
func (*Store) ListLineupChannels ¶
func (*Store) ListPlaylistSources ¶ added in v1.1.0
func (*Store) ListSettings ¶
ListSettings returns key/value settings, optionally filtered by a key prefix.
func (*Store) ListSources ¶
func (*Store) ListSourcesByChannelIDs ¶
func (*Store) ListSourcesPaged ¶
func (*Store) MarkSourceFailure ¶
func (*Store) MarkSourceSuccess ¶
func (*Store) RefreshDynamicGeneratedGuideNames ¶
RefreshDynamicGeneratedGuideNames re-synchronizes dynamic generated channel guide names from active catalog items without mutating slot/order assignments.
func (*Store) RemoveFavorite ¶
func (*Store) ReorderChannels ¶
func (*Store) ReorderDynamicGeneratedChannels ¶
func (*Store) ReorderFavorites ¶
func (*Store) ReorderSources ¶
func (*Store) RuntimePragmas ¶
func (s *Store) RuntimePragmas(ctx context.Context) (RuntimePragmas, error)
RuntimePragmas reads active SQLite runtime settings for startup logging and tests.
func (*Store) SetSetting ¶
SetSetting upserts one setting value.
func (*Store) SetSettings ¶
SetSettings upserts multiple setting values in one transaction.
func (*Store) SupportsSourceScopedDynamicChannelBlocks ¶ added in v1.1.0
SupportsSourceScopedDynamicChannelBlocks reports whether dynamic channel block synchronization supports source-scoped filtering semantics.
func (*Store) SyncDynamicChannelBlocks ¶
func (*Store) SyncDynamicSources ¶
func (*Store) SyncDynamicSourcesByCatalogFilter ¶
func (s *Store) SyncDynamicSourcesByCatalogFilter( ctx context.Context, channelID int64, sourceIDs []int64, groupNames []string, searchQuery string, searchRegex bool, pageSize int, maxMatches int, ) (channels.DynamicSourceSyncResult, int, error)
SyncDynamicSourcesByCatalogFilter synchronizes one channel's dynamic sources by iterating catalog matches in bounded pages and staging matched keys in a temp table.
func (*Store) UpdateChannel ¶
func (*Store) UpdateDynamicChannelQuery ¶
func (s *Store) UpdateDynamicChannelQuery(ctx context.Context, queryID int64, update channels.DynamicChannelQueryUpdate) (channels.DynamicChannelQuery, error)
func (*Store) UpdatePlaylistSource ¶ added in v1.1.0
func (s *Store) UpdatePlaylistSource(ctx context.Context, sourceID int64, update playlist.PlaylistSourceUpdate) (playlist.PlaylistSource, error)
func (*Store) UpdateRunProgress ¶
func (*Store) UpdateSource ¶
func (*Store) UpdateSourceProfile ¶
func (*Store) UpsertChannelDVRMapping ¶
func (s *Store) UpsertChannelDVRMapping( ctx context.Context, mapping dvr.ChannelMapping, ) (dvr.ChannelMapping, error)
func (*Store) UpsertDVRInstance ¶
func (s *Store) UpsertDVRInstance(ctx context.Context, instance dvr.InstanceConfig) (dvr.InstanceConfig, error)
func (*Store) UpsertPlaylistItems ¶
func (*Store) UpsertPlaylistItemsForSource ¶ added in v1.1.0
func (*Store) UpsertPlaylistItemsStream ¶
func (s *Store) UpsertPlaylistItemsStream(ctx context.Context, stream playlist.ItemStream) (int, error)
UpsertPlaylistItemsStream upserts playlist items from an incremental stream in one transaction.
func (*Store) UpsertPlaylistItemsStreamForSource ¶ added in v1.1.0
func (*Store) UpsertStreamMetric ¶
UpsertStreamMetric creates or updates one cached stream analysis row.
Source Files
¶
- catalog_index.go
- catalog_search_regex.go
- channel_delete_cleanup.go
- channel_key.go
- channels.go
- dvr.go
- dynamic_channel_blocks.go
- dynamic_channel_queries.go
- error_diag.go
- favorites.go
- group_names.go
- ioerr_diag.go
- job_runs.go
- like_pattern.go
- metrics.go
- op_trace.go
- playlist_sources.go
- runtime_pragmas.go
- settings.go
- store.go