Documentation
¶
Index ¶
- Constants
- Variables
- func Connect(dbPath string) (*sql.DB, error)
- func EnsureColumns(db *sql.DB, cols []ColumnDef) error
- func EnsureIndexes(db *sql.DB, indexes []IndexDef) error
- func GetSchema() string
- func GetSchemaFTS() string
- func GetSchemaTables() string
- func GetSchemaTriggers() string
- func InitDB(sqlDB *sql.DB) error
- func IsCorruptionError(err error) bool
- func IsDebugMode() bool
- func IsFtsEnabled() bool
- func Migrate(db *sql.DB) error
- func NeedsRefresh(db *sql.DB, interval time.Duration) (bool, error)
- func PopulateFolderStatsInGo(db *sql.DB) error
- func RankCaptionsResults(results []SearchCaptionsRow, query string)
- func RankSearchResults(results []SearchMediaFTSResult, query string)
- func RebuildFTS(db *sql.DB, dbPath string) error
- func RefreshFolderStats(db *sql.DB) error
- func Repair(dbPath string) error
- func RunMaintenance(db *sql.DB, config MaintenanceConfig, dbPath string) error
- func SetDebugMode(enabled bool)
- func SetFtsEnabled(enabled bool)
- type AddPlaylistItemParams
- type Captions
- type CaptionsFts
- type ColumnDef
- type CustomKeywords
- type DBTX
- type DeletePlaylistParams
- type GetAllCaptionsOrderedParams
- type GetAllCaptionsOrderedRow
- type GetAllCaptionsRow
- type GetAllMediaMetadataRow
- type GetCategoryStatsRow
- type GetGenreStatsRow
- type GetLanguageStatsRow
- type GetMediaByDurationParams
- type GetMediaByPathParams
- type GetMediaByPathPrefixParams
- type GetMediaByPlayCountParams
- type GetMediaBySizeParams
- type GetMediaByTypeParams
- type GetPlaylistItemsRow
- type GetRatingStatsRow
- type GetSiblingMediaParams
- type GetStatsByTypeRow
- type GetStatsRow
- type GetUsedCategoriesRow
- type History
- type IndexDef
- type InsertCaptionParams
- type InsertHistoryParams
- type InsertPlaylistParams
- type MaintenanceConfig
- type MaintenanceStatus
- type MarkDeletedParams
- type Media
- type MediaFts
- type PlaylistItems
- type Playlists
- type Queries
- func (q *Queries) AddPlaylistItem(ctx context.Context, arg AddPlaylistItemParams) error
- func (q *Queries) ClearPlaylist(ctx context.Context, playlistID int64) error
- func (q *Queries) DeletePlaylist(ctx context.Context, arg DeletePlaylistParams) error
- func (q *Queries) GetAllCaptions(ctx context.Context, limit int64) ([]GetAllCaptionsRow, error)
- func (q *Queries) GetAllCaptionsOrdered(ctx context.Context, arg GetAllCaptionsOrderedParams) ([]GetAllCaptionsOrderedRow, error)
- func (q *Queries) GetAllMediaMetadata(ctx context.Context) ([]GetAllMediaMetadataRow, error)
- func (q *Queries) GetCaptionsForMedia(ctx context.Context, mediaPath string) ([]Captions, error)
- func (q *Queries) GetCategoryStats(ctx context.Context) ([]GetCategoryStatsRow, error)
- func (q *Queries) GetCustomCategories(ctx context.Context) ([]string, error)
- func (q *Queries) GetGenreStats(ctx context.Context) ([]GetGenreStatsRow, error)
- func (q *Queries) GetHistoryCount(ctx context.Context, mediaPath string) (int64, error)
- func (q *Queries) GetLanguageStats(ctx context.Context) ([]GetLanguageStatsRow, error)
- func (q *Queries) GetMedia(ctx context.Context, limit int64) ([]Media, error)
- func (q *Queries) GetMediaByDuration(ctx context.Context, arg GetMediaByDurationParams) ([]Media, error)
- func (q *Queries) GetMediaByPath(ctx context.Context, arg GetMediaByPathParams) ([]Media, error)
- func (q *Queries) GetMediaByPathExact(ctx context.Context, path string) (Media, error)
- func (q *Queries) GetMediaByPathPrefix(ctx context.Context, arg GetMediaByPathPrefixParams) ([]Media, error)
- func (q *Queries) GetMediaByPlayCount(ctx context.Context, arg GetMediaByPlayCountParams) ([]Media, error)
- func (q *Queries) GetMediaBySize(ctx context.Context, arg GetMediaBySizeParams) ([]Media, error)
- func (q *Queries) GetMediaByType(ctx context.Context, arg GetMediaByTypeParams) ([]Media, error)
- func (q *Queries) GetPlaylistItems(ctx context.Context, playlistID int64) ([]GetPlaylistItemsRow, error)
- func (q *Queries) GetPlaylists(ctx context.Context) ([]Playlists, error)
- func (q *Queries) GetRandomMedia(ctx context.Context, limit int64) ([]Media, error)
- func (q *Queries) GetRatingStats(ctx context.Context) ([]GetRatingStatsRow, error)
- func (q *Queries) GetSiblingMedia(ctx context.Context, arg GetSiblingMediaParams) ([]Media, error)
- func (q *Queries) GetStats(ctx context.Context) (GetStatsRow, error)
- func (q *Queries) GetStatsByType(ctx context.Context) ([]GetStatsByTypeRow, error)
- func (q *Queries) GetUnfinishedMedia(ctx context.Context, limit int64) ([]Media, error)
- func (q *Queries) GetUnwatchedMedia(ctx context.Context, limit int64) ([]Media, error)
- func (q *Queries) GetUsedCategories(ctx context.Context) ([]GetUsedCategoriesRow, error)
- func (q *Queries) GetWatchedMedia(ctx context.Context, limit int64) ([]Media, error)
- func (q *Queries) InsertCaption(ctx context.Context, arg InsertCaptionParams) error
- func (q *Queries) InsertHistory(ctx context.Context, arg InsertHistoryParams) error
- func (q *Queries) InsertPlaylist(ctx context.Context, arg InsertPlaylistParams) (int64, error)
- func (q *Queries) MarkDeleted(ctx context.Context, arg MarkDeletedParams) error
- func (q *Queries) RemovePlaylistItem(ctx context.Context, arg RemovePlaylistItemParams) error
- func (q *Queries) SearchCaptions(ctx context.Context, arg SearchCaptionsParams) ([]SearchCaptionsRow, error)
- func (q *Queries) SearchMediaFTS(ctx context.Context, arg SearchMediaFTSParams) ([]SearchMediaFTSResult, error)
- func (q *Queries) UpdateMediaCategories(ctx context.Context, arg UpdateMediaCategoriesParams) error
- func (q *Queries) UpdatePath(ctx context.Context, arg UpdatePathParams) error
- func (q *Queries) UpdatePlayHistory(ctx context.Context, arg UpdatePlayHistoryParams) error
- func (q *Queries) UpsertMedia(ctx context.Context, arg UpsertMediaParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type RemovePlaylistItemParams
- type SearchCaptionsParams
- type SearchCaptionsRow
- type SearchMediaFTSParams
- type SearchMediaFTSResult
- type UpdateMediaCategoriesParams
- type UpdatePathParams
- type UpdatePlayHistoryParams
- type UpsertMediaParams
Constants ¶
const FtsEnabled = false
FtsEnabled is false when fts5 tag is not used (but this build is not supported)
const SlowQueryThreshold = 50 * time.Millisecond
SlowQueryThreshold is the minimum duration for a query to be considered slow
Variables ¶
var SchemaFS embed.FS
Functions ¶
func Connect ¶
Connect opens a SQLite database and applies performance tuning PRAGMAs Slow query logging (50ms threshold) is enabled when SetDebugMode(true) is called
func EnsureColumns ¶ added in v0.0.34
EnsureColumns dynamically adds missing columns to a table
func EnsureIndexes ¶ added in v0.0.34
EnsureIndexes dynamically adds missing indexes
func GetSchema ¶
func GetSchema() string
GetSchema returns the full schema (for backward compatibility if needed, but InitDB logic changed) Deprecated: Use GetSchemaTables, GetSchemaTriggers, GetSchemaFTS instead
func GetSchemaFTS ¶ added in v0.0.34
func GetSchemaFTS() string
GetSchemaFTS returns the FTS database schema SQL
func GetSchemaTables ¶ added in v0.0.34
func GetSchemaTables() string
GetSchemaTables returns the core database tables SQL
func GetSchemaTriggers ¶ added in v0.0.34
func GetSchemaTriggers() string
GetSchemaTriggers returns the core database triggers and indexes SQL
func IsCorruptionError ¶
IsCorruptionError checks if the error is a database corruption error
func IsDebugMode ¶ added in v0.0.30
func IsDebugMode() bool
IsDebugMode returns true if debug mode is enabled
func IsFtsEnabled ¶ added in v0.0.34
func IsFtsEnabled() bool
IsFtsEnabled returns true if FTS is enabled both at compile time AND runtime
func NeedsRefresh ¶ added in v0.0.34
NeedsRefresh checks if maintenance tasks need to be run based on the last refresh time
func PopulateFolderStatsInGo ¶ added in v0.0.34
PopulateFolderStatsInGo populates folder_stats using Go path manipulation This is used by both maintenance and migration code
func RankCaptionsResults ¶ added in v0.0.30
func RankCaptionsResults(results []SearchCaptionsRow, query string)
RankCaptionsResults applies in-memory ranking to caption search results
func RankSearchResults ¶ added in v0.0.30
func RankSearchResults(results []SearchMediaFTSResult, query string)
RankSearchResults applies in-memory ranking to search results This provides better relevance scoring than FTS5 with trigram + detail=none
func RebuildFTS ¶ added in v0.0.34
RebuildFTS rebuilds the FTS index
func RefreshFolderStats ¶ added in v0.0.34
RefreshFolderStats rebuilds the folder_stats materialized view
func RunMaintenance ¶ added in v0.0.34
func RunMaintenance(db *sql.DB, config MaintenanceConfig, dbPath string) error
RunMaintenance runs all maintenance tasks if needed
func SetDebugMode ¶ added in v0.0.30
func SetDebugMode(enabled bool)
SetDebugMode enables or disables debug mode for slow query logging
func SetFtsEnabled ¶ added in v0.0.34
func SetFtsEnabled(enabled bool)
SetFtsEnabled sets the runtime FTS enabled state
Types ¶
type AddPlaylistItemParams ¶
AddPlaylistItemParams are parameters for AddPlaylistItem
type Captions ¶
type Captions struct {
MediaPath string `json:"media_path"`
Time sql.NullFloat64 `json:"time"`
Text sql.NullString `json:"text"`
}
type CaptionsFts ¶
type CustomKeywords ¶
type DeletePlaylistParams ¶
DeletePlaylistParams are parameters for DeletePlaylist
type GetAllCaptionsOrderedParams ¶
type GetAllCaptionsOrderedParams struct {
VideoOnly int64
AudioOnly int64
ImageOnly int64
TextOnly int64
Limit int64
}
GetAllCaptionsOrderedParams are parameters for GetAllCaptionsOrdered
type GetAllCaptionsOrderedRow ¶
type GetAllCaptionsOrderedRow struct {
MediaPath string `json:"media_path"`
Time sql.NullFloat64 `json:"time"`
Text sql.NullString `json:"text"`
Title sql.NullString `json:"title"`
MediaType sql.NullString `json:"media_type"`
Size sql.NullInt64 `json:"size"`
Duration sql.NullInt64 `json:"duration"`
}
type GetAllCaptionsRow ¶
type GetAllCaptionsRow struct {
MediaPath string `json:"media_path"`
Time sql.NullFloat64 `json:"time"`
Text sql.NullString `json:"text"`
Title sql.NullString `json:"title"`
MediaType sql.NullString `json:"media_type"`
Size sql.NullInt64 `json:"size"`
Duration sql.NullInt64 `json:"duration"`
}
Row types for query results
type GetAllMediaMetadataRow ¶
type GetAllMediaMetadataRow struct {
Path string
Size sql.NullInt64
TimeModified sql.NullInt64
TimeDeleted sql.NullInt64
}
GetAllMediaMetadataRow is a row from GetAllMediaMetadata
type GetCategoryStatsRow ¶
GetCategoryStatsRow is a row from GetCategoryStats
type GetGenreStatsRow ¶
type GetGenreStatsRow struct {
Genre sql.NullString
Count int64
}
GetGenreStatsRow is a row from GetGenreStats
type GetLanguageStatsRow ¶
type GetLanguageStatsRow struct {
Language sql.NullString
Count int64
}
GetLanguageStatsRow is a row from GetLanguageStats
type GetMediaByDurationParams ¶
GetMediaByDurationParams are parameters for GetMediaByDuration
type GetMediaByPathParams ¶
GetMediaByPathParams are parameters for GetMediaByPath
type GetMediaByPathPrefixParams ¶
GetMediaByPathPrefixParams are parameters for GetMediaByPathPrefix
type GetMediaByPlayCountParams ¶
GetMediaByPlayCountParams are parameters for GetMediaByPlayCount
type GetMediaBySizeParams ¶
GetMediaBySizeParams are parameters for GetMediaBySize
type GetMediaByTypeParams ¶
GetMediaByTypeParams are parameters for GetMediaByType
type GetPlaylistItemsRow ¶
type GetPlaylistItemsRow struct {
Media
TrackNumber sql.NullInt64 `json:"track_number"`
TimeAdded sql.NullInt64 `json:"time_added"`
}
GetPlaylistItemsRow is a row from GetPlaylistItems
type GetRatingStatsRow ¶
GetRatingStatsRow is a row from GetRatingStats
type GetSiblingMediaParams ¶
GetSiblingMediaParams are parameters for GetSiblingMedia
type GetStatsByTypeRow ¶
type GetStatsByTypeRow struct {
MediaType sql.NullString
Count int64
TotalSize sql.NullInt64
TotalDuration sql.NullInt64
}
GetStatsByTypeRow is a row from GetStatsByType
type GetStatsRow ¶
type GetStatsRow struct {
TotalCount int64
TotalSize sql.NullInt64
TotalDuration sql.NullInt64
WatchedCount int64
UnwatchedCount int64
TotalWatchedDuration sql.NullInt64
}
GetStatsRow is a row from GetStats
type GetUsedCategoriesRow ¶
type GetUsedCategoriesRow struct {
Categories sql.NullString
Count int64
}
GetUsedCategoriesRow is a row from GetUsedCategories
type InsertCaptionParams ¶
type InsertCaptionParams struct {
MediaPath string
Time sql.NullFloat64
Text sql.NullString
}
InsertCaptionParams are parameters for InsertCaption
type InsertHistoryParams ¶
type InsertHistoryParams struct {
MediaPath string
TimePlayed sql.NullInt64
Playhead sql.NullInt64
Done sql.NullInt64
}
InsertHistoryParams are parameters for InsertHistory
type InsertPlaylistParams ¶
type InsertPlaylistParams struct {
Path sql.NullString
Title sql.NullString
ExtractorKey sql.NullString
ExtractorConfig sql.NullString
}
InsertPlaylistParams are parameters for InsertPlaylist
type MaintenanceConfig ¶ added in v0.0.34
type MaintenanceConfig struct {
// RefreshInterval is the minimum time between automatic refreshes
// Default: 72 hours
RefreshInterval time.Duration
}
MaintenanceConfig holds configuration for maintenance tasks
func DefaultMaintenanceConfig ¶ added in v0.0.34
func DefaultMaintenanceConfig() MaintenanceConfig
DefaultMaintenanceConfig returns the default maintenance configuration
type MaintenanceStatus ¶ added in v0.0.34
MaintenanceStatus holds the status of maintenance tasks
func GetMaintenanceStatus ¶ added in v0.0.34
func GetMaintenanceStatus(db *sql.DB) (MaintenanceStatus, error)
GetMaintenanceStatus returns the current status of maintenance tasks
type MarkDeletedParams ¶
MarkDeletedParams are parameters for MarkDeleted
type Media ¶
type Media struct {
Path string `json:"path"`
PathTokenized sql.NullString `json:"path_tokenized"`
Title sql.NullString `json:"title"`
Duration sql.NullInt64 `json:"duration"`
Size sql.NullInt64 `json:"size"`
TimeCreated sql.NullInt64 `json:"time_created"`
TimeModified sql.NullInt64 `json:"time_modified"`
TimeDeleted sql.NullInt64 `json:"time_deleted"`
TimeFirstPlayed sql.NullInt64 `json:"time_first_played"`
TimeLastPlayed sql.NullInt64 `json:"time_last_played"`
PlayCount sql.NullInt64 `json:"play_count"`
Playhead sql.NullInt64 `json:"playhead"`
MediaType sql.NullString `json:"media_type"`
Width sql.NullInt64 `json:"width"`
Height sql.NullInt64 `json:"height"`
Fps sql.NullFloat64 `json:"fps"`
VideoCodecs sql.NullString `json:"video_codecs"`
AudioCodecs sql.NullString `json:"audio_codecs"`
SubtitleCodecs sql.NullString `json:"subtitle_codecs"`
VideoCount sql.NullInt64 `json:"video_count"`
AudioCount sql.NullInt64 `json:"audio_count"`
SubtitleCount sql.NullInt64 `json:"subtitle_count"`
Album sql.NullString `json:"album"`
Artist sql.NullString `json:"artist"`
Genre sql.NullString `json:"genre"`
Categories sql.NullString `json:"categories"`
Description sql.NullString `json:"description"`
Language sql.NullString `json:"language"`
TimeDownloaded sql.NullInt64 `json:"time_downloaded"`
Score sql.NullFloat64 `json:"score"`
// Hash and processing status
Fasthash sql.NullString `json:"fasthash"`
Sha256 sql.NullString `json:"sha256"`
IsDeduped sql.NullInt64 `json:"is_deduped"`
}
type PlaylistItems ¶
type Playlists ¶
type Playlists struct {
ID int64 `json:"id"`
Path sql.NullString `json:"path"`
Title sql.NullString `json:"title"`
ExtractorKey sql.NullString `json:"extractor_key"`
ExtractorConfig sql.NullString `json:"extractor_config"`
TimeDeleted sql.NullInt64 `json:"time_deleted"`
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func ConnectWithInit ¶ added in v0.0.30
ConnectWithInit connects to a database and initializes it if needed Returns the database connection and a Queries object ready to use
func (*Queries) AddPlaylistItem ¶
func (q *Queries) AddPlaylistItem(ctx context.Context, arg AddPlaylistItemParams) error
AddPlaylistItem adds a media item to a playlist
func (*Queries) ClearPlaylist ¶
ClearPlaylist removes all items from a playlist
func (*Queries) DeletePlaylist ¶
func (q *Queries) DeletePlaylist(ctx context.Context, arg DeletePlaylistParams) error
DeletePlaylist marks a playlist as deleted
func (*Queries) GetAllCaptions ¶
GetAllCaptions retrieves random captions
func (*Queries) GetAllCaptionsOrdered ¶
func (q *Queries) GetAllCaptionsOrdered(ctx context.Context, arg GetAllCaptionsOrderedParams) ([]GetAllCaptionsOrderedRow, error)
GetAllCaptionsOrdered retrieves captions ordered by media path and time
func (*Queries) GetAllMediaMetadata ¶
func (q *Queries) GetAllMediaMetadata(ctx context.Context) ([]GetAllMediaMetadataRow, error)
GetAllMediaMetadata retrieves basic metadata for all media
func (*Queries) GetCaptionsForMedia ¶
GetCaptionsForMedia retrieves all captions for a media item
func (*Queries) GetCategoryStats ¶
func (q *Queries) GetCategoryStats(ctx context.Context) ([]GetCategoryStatsRow, error)
GetCategoryStats retrieves stats for each category
func (*Queries) GetCustomCategories ¶
GetCustomCategories retrieves custom keyword categories
func (*Queries) GetGenreStats ¶
func (q *Queries) GetGenreStats(ctx context.Context) ([]GetGenreStatsRow, error)
GetGenreStats retrieves stats for each genre
func (*Queries) GetHistoryCount ¶
GetHistoryCount retrieves the history count for a media item
func (*Queries) GetLanguageStats ¶
func (q *Queries) GetLanguageStats(ctx context.Context) ([]GetLanguageStatsRow, error)
GetLanguageStats retrieves stats for each language
func (*Queries) GetMediaByDuration ¶
func (q *Queries) GetMediaByDuration(ctx context.Context, arg GetMediaByDurationParams) ([]Media, error)
GetMediaByDuration retrieves media filtered by duration range
func (*Queries) GetMediaByPath ¶
GetMediaByPath retrieves media matching a path pattern
func (*Queries) GetMediaByPathExact ¶
GetMediaByPathExact retrieves a single media item by exact path match
func (*Queries) GetMediaByPathPrefix ¶
func (q *Queries) GetMediaByPathPrefix(ctx context.Context, arg GetMediaByPathPrefixParams) ([]Media, error)
GetMediaByPathPrefix retrieves media with path starting with prefix but not matching exclusion
func (*Queries) GetMediaByPlayCount ¶
func (q *Queries) GetMediaByPlayCount(ctx context.Context, arg GetMediaByPlayCountParams) ([]Media, error)
GetMediaByPlayCount retrieves media filtered by play count range
func (*Queries) GetMediaBySize ¶
GetMediaBySize retrieves media filtered by size range
func (*Queries) GetMediaByType ¶
GetMediaByType retrieves media filtered by type
func (*Queries) GetPlaylistItems ¶
func (q *Queries) GetPlaylistItems(ctx context.Context, playlistID int64) ([]GetPlaylistItemsRow, error)
GetPlaylistItems retrieves all items in a playlist
func (*Queries) GetPlaylists ¶
GetPlaylists retrieves all non-deleted playlists
func (*Queries) GetRandomMedia ¶
GetRandomMedia retrieves random media items
func (*Queries) GetRatingStats ¶
func (q *Queries) GetRatingStats(ctx context.Context) ([]GetRatingStatsRow, error)
GetRatingStats retrieves stats for each rating
func (*Queries) GetSiblingMedia ¶
GetSiblingMedia retrieves media with similar paths (siblings)
func (*Queries) GetStats ¶
func (q *Queries) GetStats(ctx context.Context) (GetStatsRow, error)
GetStats retrieves overall stats
func (*Queries) GetStatsByType ¶
func (q *Queries) GetStatsByType(ctx context.Context) ([]GetStatsByTypeRow, error)
GetStatsByType retrieves stats grouped by type
func (*Queries) GetUnfinishedMedia ¶
GetUnfinishedMedia retrieves media that was started but not finished
func (*Queries) GetUnwatchedMedia ¶
GetUnwatchedMedia retrieves media that has not been watched
func (*Queries) GetUsedCategories ¶
func (q *Queries) GetUsedCategories(ctx context.Context) ([]GetUsedCategoriesRow, error)
GetUsedCategories retrieves categories that are in use
func (*Queries) GetWatchedMedia ¶
GetWatchedMedia retrieves media that has been watched
func (*Queries) InsertCaption ¶
func (q *Queries) InsertCaption(ctx context.Context, arg InsertCaptionParams) error
InsertCaption inserts a caption for a media item
func (*Queries) InsertHistory ¶
func (q *Queries) InsertHistory(ctx context.Context, arg InsertHistoryParams) error
InsertHistory inserts a history entry
func (*Queries) InsertPlaylist ¶
InsertPlaylist inserts a new playlist or updates existing
func (*Queries) MarkDeleted ¶
func (q *Queries) MarkDeleted(ctx context.Context, arg MarkDeletedParams) error
MarkDeleted marks a media item as deleted
func (*Queries) RemovePlaylistItem ¶
func (q *Queries) RemovePlaylistItem(ctx context.Context, arg RemovePlaylistItemParams) error
RemovePlaylistItem removes a media item from a playlist
func (*Queries) SearchCaptions ¶
func (q *Queries) SearchCaptions(ctx context.Context, arg SearchCaptionsParams) ([]SearchCaptionsRow, error)
SearchCaptions searches captions using FTS5 with trigram-compatible queries
func (*Queries) SearchMediaFTS ¶
func (q *Queries) SearchMediaFTS(ctx context.Context, arg SearchMediaFTSParams) ([]SearchMediaFTSResult, error)
SearchMediaFTS searches media using FTS5 with trigram-compatible queries
func (*Queries) UpdateMediaCategories ¶
func (q *Queries) UpdateMediaCategories(ctx context.Context, arg UpdateMediaCategoriesParams) error
UpdateMediaCategories updates categories for a media item
func (*Queries) UpdatePath ¶
func (q *Queries) UpdatePath(ctx context.Context, arg UpdatePathParams) error
UpdatePath updates the path of a media item
func (*Queries) UpdatePlayHistory ¶
func (q *Queries) UpdatePlayHistory(ctx context.Context, arg UpdatePlayHistoryParams) error
UpdatePlayHistory updates play history for a media item
func (*Queries) UpsertMedia ¶
func (q *Queries) UpsertMedia(ctx context.Context, arg UpsertMediaParams) error
UpsertMedia inserts or updates a media item
type RemovePlaylistItemParams ¶
RemovePlaylistItemParams are parameters for RemovePlaylistItem
type SearchCaptionsParams ¶
type SearchCaptionsParams struct {
Query string
VideoOnly bool
AudioOnly bool
ImageOnly bool
TextOnly bool
Limit int64
}
SearchCaptionsParams are parameters for caption search
type SearchCaptionsRow ¶
type SearchCaptionsRow struct {
MediaPath string
Time sql.NullFloat64
Text sql.NullString
Title sql.NullString
MediaType sql.NullString
Size sql.NullInt64
Duration sql.NullInt64
Rank float64
}
SearchCaptionsRow represents a row from caption search with optional rank
type SearchMediaFTSParams ¶
SearchMediaFTSParams are parameters for FTS media search
type SearchMediaFTSResult ¶ added in v0.0.30
SearchMediaFTSResult is a Media item with optional rank
type UpdateMediaCategoriesParams ¶
type UpdateMediaCategoriesParams struct {
Categories sql.NullString
Path string
}
UpdateMediaCategoriesParams are parameters for UpdateMediaCategories
type UpdatePathParams ¶
UpdatePathParams are parameters for UpdatePath
type UpdatePlayHistoryParams ¶
type UpdatePlayHistoryParams struct {
TimeLastPlayed sql.NullInt64
TimeFirstPlayed sql.NullInt64
Playhead sql.NullInt64
Path string
}
UpdatePlayHistoryParams are parameters for UpdatePlayHistory
type UpsertMediaParams ¶
type UpsertMediaParams struct {
Path string
PathTokenized sql.NullString
Title sql.NullString
Duration sql.NullInt64
Size sql.NullInt64
TimeCreated sql.NullInt64
TimeModified sql.NullInt64
MediaType sql.NullString
Width sql.NullInt64
Height sql.NullInt64
Fps sql.NullFloat64
VideoCodecs sql.NullString
AudioCodecs sql.NullString
SubtitleCodecs sql.NullString
VideoCount sql.NullInt64
AudioCount sql.NullInt64
SubtitleCount sql.NullInt64
Album sql.NullString
Artist sql.NullString
Genre sql.NullString
Categories sql.NullString
Description sql.NullString
Language sql.NullString
TimeDownloaded sql.NullInt64
Score sql.NullFloat64
Fasthash sql.NullString
Sha256 sql.NullString
IsDeduped sql.NullInt64
}
UpsertMediaParams are parameters for UpsertMedia