store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LanguageCount

type LanguageCount struct {
	Language string
	Count    int
}

type SearchParams

type SearchParams struct {
	ImdbID   string
	Language string
	Slug     string
	HI       *bool
	Year     int
	Query    string
	SeasonEp string
	Limit    int
	Offset   int
}

type Store

type Store interface {
	GetSubtitle(ctx context.Context, id string) (*Subtitle, error)
	InsertSubtitle(ctx context.Context, s *Subtitle) (bool, error)
	InsertSubtitleBatch(ctx context.Context, subs []*Subtitle) (inserted, skipped, errors int)
	IncrementDownloads(ctx context.Context, id string) error
	ListLanguages(ctx context.Context) ([]LanguageCount, error)
	SearchSubtitles(ctx context.Context, p SearchParams) ([]Subtitle, int, error)
}

func New

func New(db *sql.DB, driver string) (Store, error)

New creates a Store for the given database driver.

type Subtitle

type Subtitle struct {
	ID          string
	SubsceneID  string
	Title       string
	Slug        string
	ImdbID      string
	Language    string
	HI          bool
	Author      string
	Releases    string // JSON array as string
	Comment     string
	Year        int
	Filename    string
	Format      string
	ContentKey  string
	ContentHash string
	UploadedAt  string
	Downloads   int
}

Subtitle is the common model shared across all database dialects.

Jump to

Keyboard shortcuts

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