db

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const FtsEnabled = false

FtsEnabled is false when fts5 tag is not used (but this build is not supported)

View Source
const SlowQueryThreshold = 50 * time.Millisecond

SlowQueryThreshold is the minimum duration for a query to be considered slow

Variables

View Source
var SchemaFS embed.FS

Functions

func Connect

func Connect(dbPath string) (*sql.DB, error)

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

func EnsureColumns(db *sql.DB, cols []ColumnDef) error

EnsureColumns dynamically adds missing columns to a table

func EnsureIndexes added in v0.0.34

func EnsureIndexes(db *sql.DB, indexes []IndexDef) error

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 InitDB

func InitDB(sqlDB *sql.DB) error

func IsCorruptionError

func IsCorruptionError(err error) bool

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 Migrate

func Migrate(db *sql.DB) error

Migrate runs schema migrations on an existing database

func NeedsRefresh added in v0.0.34

func NeedsRefresh(db *sql.DB, interval time.Duration) (bool, error)

NeedsRefresh checks if maintenance tasks need to be run based on the last refresh time

func PopulateFolderStatsInGo added in v0.0.34

func PopulateFolderStatsInGo(db *sql.DB) error

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

func RebuildFTS(db *sql.DB, dbPath string) error

RebuildFTS rebuilds the FTS index

func RefreshFolderStats added in v0.0.34

func RefreshFolderStats(db *sql.DB) error

RefreshFolderStats rebuilds the folder_stats materialized view

func Repair

func Repair(dbPath string) error

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

type AddPlaylistItemParams struct {
	PlaylistID  int64
	MediaPath   string
	TrackNumber sql.NullInt64
}

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 CaptionsFts struct {
	MediaPath string `json:"media_path"`
	Text      string `json:"text"`
}

type ColumnDef added in v0.0.34

type ColumnDef struct {
	Table  string
	Column string
	Schema string
}

type CustomKeywords

type CustomKeywords struct {
	Category string `json:"category"`
	Keyword  string `json:"keyword"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...any) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...any) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...any) *sql.Row
}

type DeletePlaylistParams

type DeletePlaylistParams struct {
	TimeDeleted sql.NullInt64
	ID          int64
}

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

type GetCategoryStatsRow struct {
	Category string
	Count    int64
}

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

type GetMediaByDurationParams struct {
	MinDuration int64
	MaxDuration int64
	Limit       int64
}

GetMediaByDurationParams are parameters for GetMediaByDuration

type GetMediaByPathParams

type GetMediaByPathParams struct {
	PathPattern string
	Limit       int64
}

GetMediaByPathParams are parameters for GetMediaByPath

type GetMediaByPathPrefixParams

type GetMediaByPathPrefixParams struct {
	PathPrefix string
	PathNot    string
	Limit      int64
}

GetMediaByPathPrefixParams are parameters for GetMediaByPathPrefix

type GetMediaByPlayCountParams

type GetMediaByPlayCountParams struct {
	MinPlayCount int64
	MaxPlayCount int64
	Limit        int64
}

GetMediaByPlayCountParams are parameters for GetMediaByPlayCount

type GetMediaBySizeParams

type GetMediaBySizeParams struct {
	MinSize int64
	MaxSize int64
	Limit   int64
}

GetMediaBySizeParams are parameters for GetMediaBySize

type GetMediaByTypeParams

type GetMediaByTypeParams struct {
	VideoOnly bool
	AudioOnly bool
	ImageOnly bool
	Limit     int64
}

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

type GetRatingStatsRow struct {
	Rating int64
	Count  int64
}

GetRatingStatsRow is a row from GetRatingStats

type GetSiblingMediaParams

type GetSiblingMediaParams struct {
	PathPattern string
	PathExclude string
	Limit       int64
}

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 History

type History struct {
	ID         int64         `json:"id"`
	MediaPath  string        `json:"media_path"`
	TimePlayed sql.NullInt64 `json:"time_played"`
	Playhead   sql.NullInt64 `json:"playhead"`
	Done       sql.NullInt64 `json:"done"`
}

type IndexDef added in v0.0.34

type IndexDef struct {
	Name string
	SQL  string
}

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

type MaintenanceStatus struct {
	FolderStatsLastRefresh time.Time
	FTSLastRebuild         time.Time
}

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

type MarkDeletedParams struct {
	TimeDeleted sql.NullInt64
	Path        string
}

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 MediaFts

type MediaFts struct {
	Path          string `json:"path"`
	PathTokenized string `json:"path_tokenized"`
	Title         string `json:"title"`
	Description   string `json:"description"`
}

type PlaylistItems

type PlaylistItems struct {
	PlaylistID  int64         `json:"playlist_id"`
	MediaPath   string        `json:"media_path"`
	TrackNumber sql.NullInt64 `json:"track_number"`
	TimeAdded   sql.NullInt64 `json:"time_added"`
}

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

func ConnectWithInit(dbPath string) (*sql.DB, *Queries, error)

ConnectWithInit connects to a database and initializes it if needed Returns the database connection and a Queries object ready to use

func New

func New(db DBTX) *Queries

func (*Queries) AddPlaylistItem

func (q *Queries) AddPlaylistItem(ctx context.Context, arg AddPlaylistItemParams) error

AddPlaylistItem adds a media item to a playlist

func (*Queries) ClearPlaylist

func (q *Queries) ClearPlaylist(ctx context.Context, playlistID int64) error

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

func (q *Queries) GetAllCaptions(ctx context.Context, limit int64) ([]GetAllCaptionsRow, error)

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

func (q *Queries) GetCaptionsForMedia(ctx context.Context, mediaPath string) ([]Captions, error)

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

func (q *Queries) GetCustomCategories(ctx context.Context) ([]string, error)

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

func (q *Queries) GetHistoryCount(ctx context.Context, mediaPath string) (int64, error)

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) GetMedia

func (q *Queries) GetMedia(ctx context.Context, limit int64) ([]Media, error)

GetMedia retrieves all non-deleted media

func (*Queries) GetMediaByDuration

func (q *Queries) GetMediaByDuration(ctx context.Context, arg GetMediaByDurationParams) ([]Media, error)

GetMediaByDuration retrieves media filtered by duration range

func (*Queries) GetMediaByPath

func (q *Queries) GetMediaByPath(ctx context.Context, arg GetMediaByPathParams) ([]Media, error)

GetMediaByPath retrieves media matching a path pattern

func (*Queries) GetMediaByPathExact

func (q *Queries) GetMediaByPathExact(ctx context.Context, path string) (Media, error)

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

func (q *Queries) GetMediaBySize(ctx context.Context, arg GetMediaBySizeParams) ([]Media, error)

GetMediaBySize retrieves media filtered by size range

func (*Queries) GetMediaByType

func (q *Queries) GetMediaByType(ctx context.Context, arg GetMediaByTypeParams) ([]Media, error)

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

func (q *Queries) GetPlaylists(ctx context.Context) ([]Playlists, error)

GetPlaylists retrieves all non-deleted playlists

func (*Queries) GetRandomMedia

func (q *Queries) GetRandomMedia(ctx context.Context, limit int64) ([]Media, error)

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

func (q *Queries) GetSiblingMedia(ctx context.Context, arg GetSiblingMediaParams) ([]Media, error)

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

func (q *Queries) GetUnfinishedMedia(ctx context.Context, limit int64) ([]Media, error)

GetUnfinishedMedia retrieves media that was started but not finished

func (*Queries) GetUnwatchedMedia

func (q *Queries) GetUnwatchedMedia(ctx context.Context, limit int64) ([]Media, error)

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

func (q *Queries) GetWatchedMedia(ctx context.Context, limit int64) ([]Media, error)

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

func (q *Queries) InsertPlaylist(ctx context.Context, arg InsertPlaylistParams) (int64, error)

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

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RemovePlaylistItemParams

type RemovePlaylistItemParams struct {
	PlaylistID int64
	MediaPath  string
}

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

type SearchMediaFTSParams struct {
	Query string
	Limit int64
}

SearchMediaFTSParams are parameters for FTS media search

type SearchMediaFTSResult added in v0.0.30

type SearchMediaFTSResult struct {
	Media Media
	Rank  float64
}

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

type UpdatePathParams struct {
	NewPath string
	OldPath string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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