database

package
v0.2.10-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const SqliteTimeFormat = "2006-01-02 15:04:05"

SqliteTimeFormat is used to format time.Time values for SQLite datetime comparisons. SQLite stores timestamps as TEXT in inconsistent formats (RFC3339 with T/Z, with fractional seconds, etc.) and GORM binds time.Time as "2006-01-02 15:04:05" (space, no TZ). Direct TEXT comparison between these formats produces wrong results because 'T' > ' ' and fractional seconds alter lexicographic order. Wrapping both sides in datetime() normalizes to a consistent format before comparison.

Variables

View Source
var (
	ErrActressMergeSameID           = errors.New("target_id and source_id must be different")
	ErrActressMergeInvalidID        = errors.New("target_id and source_id must be greater than 0")
	ErrActressMergeInvalidField     = errors.New("invalid merge field")
	ErrActressMergeInvalidDecision  = errors.New("invalid merge resolution")
	ErrActressMergeUniqueConstraint = errors.New("merge would violate unique constraints")
)
View Source
var ErrNotFound = errors.New("record not found")

Functions

func ComputeMigrationHash

func ComputeMigrationHash(content []byte) string

func EnsureMigrationHashTable

func EnsureMigrationHashTable(db *sql.DB) error

func GetStoredHash

func GetStoredHash(db *sql.DB, name string) (string, error)

func HashMatches

func HashMatches(db *sql.DB, name string, content []byte) (bool, string, error)

func IsNotFound

func IsNotFound(err error) bool

func StoreMigrationHash

func StoreMigrationHash(db *sql.DB, name, hash string) error

Types

type ActressAliasRepository

type ActressAliasRepository struct {
	// contains filtered or unexported fields
}

ActressAliasRepository provides database operations for actress aliases

func NewActressAliasRepository

func NewActressAliasRepository(db *DB) *ActressAliasRepository

NewActressAliasRepository creates a new actress alias repository

func (*ActressAliasRepository) Create

func (r *ActressAliasRepository) Create(alias *models.ActressAlias) error

Create adds a new actress alias

func (*ActressAliasRepository) Delete

func (r *ActressAliasRepository) Delete(aliasName string) error

Delete removes an actress alias

func (*ActressAliasRepository) FindByAliasName

func (r *ActressAliasRepository) FindByAliasName(aliasName string) (*models.ActressAlias, error)

FindByAliasName finds a canonical name by alias

func (*ActressAliasRepository) FindByCanonicalName

func (r *ActressAliasRepository) FindByCanonicalName(canonicalName string) ([]models.ActressAlias, error)

FindByCanonicalName finds all aliases for a canonical name

func (*ActressAliasRepository) GetAliasMap

func (r *ActressAliasRepository) GetAliasMap() (map[string]string, error)

GetAliasMap returns all aliases as a map[aliasName]canonicalName

func (*ActressAliasRepository) List

List returns all actress aliases

func (*ActressAliasRepository) Upsert

func (r *ActressAliasRepository) Upsert(alias *models.ActressAlias) error

Upsert creates or updates an actress alias

type ActressAliasRepositoryInterface

type ActressAliasRepositoryInterface interface {
	Create(alias *models.ActressAlias) error
	Upsert(alias *models.ActressAlias) error
	FindByAliasName(aliasName string) (*models.ActressAlias, error)
	FindByCanonicalName(canonicalName string) ([]models.ActressAlias, error)
	List() ([]models.ActressAlias, error)
	Delete(aliasName string) error
	GetAliasMap() (map[string]string, error)
}

ActressAliasRepositoryInterface defines the contract for actress alias operations

type ActressMergeConflict

type ActressMergeConflict struct {
	Field             string      `json:"field"`
	TargetValue       interface{} `json:"target_value,omitempty"`
	SourceValue       interface{} `json:"source_value,omitempty"`
	DefaultResolution string      `json:"default_resolution"`
}

type ActressMergePreview

type ActressMergePreview struct {
	Target             models.Actress                  `json:"target"`
	Source             models.Actress                  `json:"source"`
	ProposedMerged     models.Actress                  `json:"proposed_merged"`
	Conflicts          []ActressMergeConflict          `json:"conflicts"`
	DefaultResolutions map[string]string               `json:"default_resolutions"`
	ConflictByField    map[string]ActressMergeConflict `json:"-"`
}

type ActressMergeResult

type ActressMergeResult struct {
	MergedActress     models.Actress `json:"merged_actress"`
	MergedFromID      uint           `json:"merged_from_id"`
	UpdatedMovies     int            `json:"updated_movies"`
	ConflictsResolved int            `json:"conflicts_resolved"`
	AliasesAdded      int            `json:"aliases_added"`
}

type ActressRepository

type ActressRepository struct {
	// contains filtered or unexported fields
}

func NewActressRepository

func NewActressRepository(db *DB) *ActressRepository

func (*ActressRepository) Count

func (r *ActressRepository) Count() (int64, error)

func (*ActressRepository) CountSearch

func (r *ActressRepository) CountSearch(query string) (int64, error)

func (*ActressRepository) Create

func (r *ActressRepository) Create(actress *models.Actress) error

func (*ActressRepository) Delete

func (r *ActressRepository) Delete(id uint) error

func (*ActressRepository) FindByID

func (r *ActressRepository) FindByID(id uint) (*models.Actress, error)

func (*ActressRepository) FindByJapaneseName

func (r *ActressRepository) FindByJapaneseName(name string) (*models.Actress, error)

func (*ActressRepository) FindOrCreate

func (r *ActressRepository) FindOrCreate(actress *models.Actress) error

func (*ActressRepository) List

func (r *ActressRepository) List(limit, offset int) ([]models.Actress, error)

func (*ActressRepository) ListSorted

func (r *ActressRepository) ListSorted(limit, offset int, sortBy, sortOrder string) ([]models.Actress, error)

func (*ActressRepository) Merge

func (r *ActressRepository) Merge(targetID, sourceID uint, resolutions map[string]string) (*ActressMergeResult, error)

func (*ActressRepository) PreviewMerge

func (r *ActressRepository) PreviewMerge(targetID, sourceID uint) (*ActressMergePreview, error)

func (*ActressRepository) Search

func (r *ActressRepository) Search(query string) ([]models.Actress, error)

func (*ActressRepository) SearchPaged

func (r *ActressRepository) SearchPaged(query string, limit, offset int) ([]models.Actress, error)

func (*ActressRepository) SearchPagedSorted

func (r *ActressRepository) SearchPagedSorted(query string, limit, offset int, sortBy, sortOrder string) ([]models.Actress, error)

func (*ActressRepository) Update

func (r *ActressRepository) Update(actress *models.Actress) error

type ActressRepositoryInterface

type ActressRepositoryInterface interface {
	Create(actress *models.Actress) error
	Update(actress *models.Actress) error
	FindByJapaneseName(name string) (*models.Actress, error)
	FindOrCreate(actress *models.Actress) error
	List(limit, offset int) ([]models.Actress, error)
	Search(query string) ([]models.Actress, error)
}

ActressRepositoryInterface defines the contract for actress database operations

type BatchFileOperationRepository

type BatchFileOperationRepository struct {
	// contains filtered or unexported fields
}

BatchFileOperationRepository provides database operations for batch file operations

func NewBatchFileOperationRepository

func NewBatchFileOperationRepository(db *DB) *BatchFileOperationRepository

NewBatchFileOperationRepository creates a new batch file operation repository

func (*BatchFileOperationRepository) CountByBatchJobID

func (r *BatchFileOperationRepository) CountByBatchJobID(batchJobID string) (int64, error)

CountByBatchJobID returns the count of operations for a specific batch job

func (*BatchFileOperationRepository) CountByBatchJobIDAndRevertStatus

func (r *BatchFileOperationRepository) CountByBatchJobIDAndRevertStatus(batchJobID string, status string) (int64, error)

CountByBatchJobIDAndRevertStatus returns the count of operations filtered by batch job and revert status

func (*BatchFileOperationRepository) Create

Create adds a new batch file operation record

func (*BatchFileOperationRepository) CreateBatch

CreateBatch inserts multiple batch file operation records in a single transaction

func (*BatchFileOperationRepository) FindByBatchJobID

func (r *BatchFileOperationRepository) FindByBatchJobID(batchJobID string) ([]models.BatchFileOperation, error)

FindByBatchJobID returns all operations for a specific batch job

func (*BatchFileOperationRepository) FindByBatchJobIDAndRevertStatus

func (r *BatchFileOperationRepository) FindByBatchJobIDAndRevertStatus(batchJobID string, revertStatus string) ([]models.BatchFileOperation, error)

FindByBatchJobIDAndRevertStatus returns operations filtered by batch job and revert status

func (*BatchFileOperationRepository) FindByID

FindByID finds a batch file operation by its primary key

func (*BatchFileOperationRepository) Update

Update persists changes to an existing BatchFileOperation record using GORM Save (upsert). Updates all fields including UpdatedAt.

func (*BatchFileOperationRepository) UpdateRevertStatus

func (r *BatchFileOperationRepository) UpdateRevertStatus(id uint, status string) error

UpdateRevertStatus changes the revert status and sets reverted_at when status is "reverted"

type BatchFileOperationRepositoryInterface

type BatchFileOperationRepositoryInterface interface {
	Create(op *models.BatchFileOperation) error
	CreateBatch(ops []*models.BatchFileOperation) error
	FindByID(id uint) (*models.BatchFileOperation, error)
	FindByBatchJobID(batchJobID string) ([]models.BatchFileOperation, error)
	FindByBatchJobIDAndRevertStatus(batchJobID string, revertStatus string) ([]models.BatchFileOperation, error)
	Update(op *models.BatchFileOperation) error
	UpdateRevertStatus(id uint, status string) error
	CountByBatchJobID(batchJobID string) (int64, error)
	CountByBatchJobIDAndRevertStatus(batchJobID string, status string) (int64, error)
}

BatchFileOperationRepositoryInterface defines the contract for batch file operation operations

type ContentIDMappingRepository

type ContentIDMappingRepository struct {
	// contains filtered or unexported fields
}

ContentIDMappingRepository provides database operations for content ID mappings

func NewContentIDMappingRepository

func NewContentIDMappingRepository(db *DB) *ContentIDMappingRepository

NewContentIDMappingRepository creates a new content ID mapping repository

func (*ContentIDMappingRepository) Create

Create saves a new content ID mapping to the database If a mapping with the same search ID already exists, it will be updated

func (*ContentIDMappingRepository) Delete

func (r *ContentIDMappingRepository) Delete(searchID string) error

Delete removes a content ID mapping from the database

func (*ContentIDMappingRepository) FindBySearchID

func (r *ContentIDMappingRepository) FindBySearchID(searchID string) (*models.ContentIDMapping, error)

FindBySearchID looks up a content ID mapping by the search ID Search IDs are normalized to uppercase for case-insensitive matching

func (*ContentIDMappingRepository) GetAll

GetAll retrieves all content ID mappings

type ContentIDMappingRepositoryInterface

type ContentIDMappingRepositoryInterface interface {
	FindBySearchID(searchID string) (*models.ContentIDMapping, error)
	Create(mapping *models.ContentIDMapping) error
	Delete(searchID string) error
	GetAll() ([]models.ContentIDMapping, error)
}

ContentIDMappingRepositoryInterface defines the contract for content ID mapping operations

type DB

type DB struct {
	*gorm.DB
	// contains filtered or unexported fields
}

DB wraps the GORM database connection

func New

func New(cfg *config.Config) (*DB, error)

New creates a new database connection

func (*DB) AutoMigrate

func (db *DB) AutoMigrate() error

AutoMigrate runs startup database migrations.

Kept for backward compatibility in tests and existing call sites. New runtime paths should call RunMigrationsOnStartup directly.

func (*DB) Close

func (db *DB) Close() error

Close closes the database connection

func (*DB) RunMigrationsOnStartup

func (db *DB) RunMigrationsOnStartup(ctx context.Context) (err error)

RunMigrationsOnStartup applies all pending versioned database migrations.

The migration flow is fail-fast: - acquire startup migration lock - check pending migrations - create a pre-migration SQLite backup snapshot when pending work exists - apply migrations

type EventFilter

type EventFilter struct {
	EventType string
	Severity  string
	Source    string
	Start     *time.Time
	End       *time.Time
}

EventFilter holds optional filter parameters for composable event queries

type EventRepository

type EventRepository struct {
	// contains filtered or unexported fields
}

func NewEventRepository

func NewEventRepository(db *DB) *EventRepository

func (*EventRepository) Count

func (r *EventRepository) Count() (int64, error)

func (*EventRepository) CountByDateRange

func (r *EventRepository) CountByDateRange(start, end time.Time) (int64, error)

func (*EventRepository) CountBySeverity

func (r *EventRepository) CountBySeverity(severity string) (int64, error)

func (*EventRepository) CountBySource

func (r *EventRepository) CountBySource(source string) (int64, error)

func (*EventRepository) CountByType

func (r *EventRepository) CountByType(eventType string) (int64, error)

func (*EventRepository) CountByTypeAndSeverity

func (r *EventRepository) CountByTypeAndSeverity(eventType, severity string) (int64, error)

func (*EventRepository) CountFiltered

func (r *EventRepository) CountFiltered(filter EventFilter) (int64, error)

func (*EventRepository) CountGroupBySource

func (r *EventRepository) CountGroupBySource() (map[string]int64, error)

func (*EventRepository) Create

func (r *EventRepository) Create(event *models.Event) error

func (*EventRepository) DeleteOlderThan

func (r *EventRepository) DeleteOlderThan(date time.Time) error

func (*EventRepository) FindByDateRange

func (r *EventRepository) FindByDateRange(start, end time.Time, limit, offset int) ([]models.Event, error)

func (*EventRepository) FindByID

func (r *EventRepository) FindByID(id uint) (*models.Event, error)

func (*EventRepository) FindBySeverity

func (r *EventRepository) FindBySeverity(severity string, limit, offset int) ([]models.Event, error)

func (*EventRepository) FindBySource

func (r *EventRepository) FindBySource(source string, limit, offset int) ([]models.Event, error)

func (*EventRepository) FindByType

func (r *EventRepository) FindByType(eventType string, limit, offset int) ([]models.Event, error)

func (*EventRepository) FindByTypeAndSeverity

func (r *EventRepository) FindByTypeAndSeverity(eventType, severity string, limit, offset int) ([]models.Event, error)

func (*EventRepository) FindFiltered

func (r *EventRepository) FindFiltered(filter EventFilter, limit, offset int) ([]models.Event, error)

func (*EventRepository) List

func (r *EventRepository) List(limit, offset int) ([]models.Event, error)

type EventRepositoryInterface

type EventRepositoryInterface interface {
	Create(event *models.Event) error
	FindByID(id uint) (*models.Event, error)
	FindByType(eventType string, limit, offset int) ([]models.Event, error)
	FindBySeverity(severity string, limit, offset int) ([]models.Event, error)
	FindByTypeAndSeverity(eventType, severity string, limit, offset int) ([]models.Event, error)
	FindBySource(source string, limit, offset int) ([]models.Event, error)
	FindByDateRange(start, end time.Time, limit, offset int) ([]models.Event, error)
	FindFiltered(filter EventFilter, limit, offset int) ([]models.Event, error)
	CountFiltered(filter EventFilter) (int64, error)
	List(limit, offset int) ([]models.Event, error)
	Count() (int64, error)
	CountByType(eventType string) (int64, error)
	CountBySeverity(severity string) (int64, error)
	CountByTypeAndSeverity(eventType, severity string) (int64, error)
	CountBySource(source string) (int64, error)
	CountGroupBySource() (map[string]int64, error)
	CountByDateRange(start, end time.Time) (int64, error)
	DeleteOlderThan(date time.Time) error
}

EventRepositoryInterface defines the contract for structured event logging operations

type GenreReplacementRepository

type GenreReplacementRepository struct {
	// contains filtered or unexported fields
}

GenreReplacementRepository provides database operations for genre replacements

func NewGenreReplacementRepository

func NewGenreReplacementRepository(db *DB) *GenreReplacementRepository

NewGenreReplacementRepository creates a new genre replacement repository

func (*GenreReplacementRepository) Create

func (r *GenreReplacementRepository) Create(replacement *models.GenreReplacement) error

Create adds a new genre replacement

func (*GenreReplacementRepository) Delete

func (r *GenreReplacementRepository) Delete(original string) error

Delete removes a genre replacement

func (*GenreReplacementRepository) FindByOriginal

func (r *GenreReplacementRepository) FindByOriginal(original string) (*models.GenreReplacement, error)

FindByOriginal finds a replacement by original genre name

func (*GenreReplacementRepository) GetReplacementMap

func (r *GenreReplacementRepository) GetReplacementMap() (map[string]string, error)

GetReplacementMap returns all replacements as a map[original]replacement

func (*GenreReplacementRepository) List

List returns all genre replacements

func (*GenreReplacementRepository) Upsert

func (r *GenreReplacementRepository) Upsert(replacement *models.GenreReplacement) error

Upsert creates or updates a genre replacement

type GenreReplacementRepositoryInterface

type GenreReplacementRepositoryInterface interface {
	Create(replacement *models.GenreReplacement) error
	Upsert(replacement *models.GenreReplacement) error
	FindByOriginal(original string) (*models.GenreReplacement, error)
	List() ([]models.GenreReplacement, error)
	Delete(original string) error
	GetReplacementMap() (map[string]string, error)
}

GenreReplacementRepositoryInterface defines the contract for genre replacement operations

type GenreRepository

type GenreRepository struct {
	// contains filtered or unexported fields
}

GenreRepository provides database operations for genres

func NewGenreRepository

func NewGenreRepository(db *DB) *GenreRepository

NewGenreRepository creates a new genre repository

func (*GenreRepository) FindOrCreate

func (r *GenreRepository) FindOrCreate(name string) (*models.Genre, error)

FindOrCreate finds a genre or creates a new one

func (*GenreRepository) List

func (r *GenreRepository) List() ([]models.Genre, error)

List returns all genres

type HistoryRepository

type HistoryRepository struct {
	// contains filtered or unexported fields
}

func NewHistoryRepository

func NewHistoryRepository(db *DB) *HistoryRepository

func (*HistoryRepository) Count

func (r *HistoryRepository) Count() (int64, error)

func (*HistoryRepository) CountByOperation

func (r *HistoryRepository) CountByOperation(operation string) (int64, error)

func (*HistoryRepository) CountByStatus

func (r *HistoryRepository) CountByStatus(status string) (int64, error)

func (*HistoryRepository) Create

func (r *HistoryRepository) Create(history *models.History) error

func (*HistoryRepository) Delete

func (r *HistoryRepository) Delete(id uint) error

func (*HistoryRepository) DeleteByMovieID

func (r *HistoryRepository) DeleteByMovieID(movieID string) error

func (*HistoryRepository) DeleteOlderThan

func (r *HistoryRepository) DeleteOlderThan(date time.Time) error

func (*HistoryRepository) FindByBatchJobID

func (r *HistoryRepository) FindByBatchJobID(batchJobID string) ([]models.History, error)

func (*HistoryRepository) FindByDateRange

func (r *HistoryRepository) FindByDateRange(start, end time.Time) ([]models.History, error)

func (*HistoryRepository) FindByID

func (r *HistoryRepository) FindByID(id uint) (*models.History, error)

func (*HistoryRepository) FindByMovieID

func (r *HistoryRepository) FindByMovieID(movieID string) ([]models.History, error)

func (*HistoryRepository) FindByOperation

func (r *HistoryRepository) FindByOperation(operation string, limit int) ([]models.History, error)

func (*HistoryRepository) FindByStatus

func (r *HistoryRepository) FindByStatus(status string, limit int) ([]models.History, error)

func (*HistoryRepository) FindRecent

func (r *HistoryRepository) FindRecent(limit int) ([]models.History, error)

func (*HistoryRepository) List

func (r *HistoryRepository) List(limit, offset int) ([]models.History, error)

type HistoryRepositoryInterface

type HistoryRepositoryInterface interface {
	Create(history *models.History) error
	FindByID(id uint) (*models.History, error)
	FindByMovieID(movieID string) ([]models.History, error)
	FindByBatchJobID(batchJobID string) ([]models.History, error)
	FindByOperation(operation string, limit int) ([]models.History, error)
	FindByStatus(status string, limit int) ([]models.History, error)
	FindRecent(limit int) ([]models.History, error)
	FindByDateRange(start, end time.Time) ([]models.History, error)
	Count() (int64, error)
	CountByStatus(status string) (int64, error)
	CountByOperation(operation string) (int64, error)
	Delete(id uint) error
	DeleteByMovieID(movieID string) error
	DeleteOlderThan(date time.Time) error
	List(limit, offset int) ([]models.History, error)
}

HistoryRepositoryInterface defines the contract for history tracking operations

type JobRepository

type JobRepository struct {
	// contains filtered or unexported fields
}

func NewJobRepository

func NewJobRepository(db *DB) *JobRepository

func (*JobRepository) Create

func (r *JobRepository) Create(job *models.Job) error

func (*JobRepository) Delete

func (r *JobRepository) Delete(id string) error

func (*JobRepository) DeleteOrganizedOlderThan

func (r *JobRepository) DeleteOrganizedOlderThan(date time.Time) error

func (*JobRepository) FindByID

func (r *JobRepository) FindByID(id string) (*models.Job, error)

func (*JobRepository) List

func (r *JobRepository) List() ([]models.Job, error)

func (*JobRepository) Update

func (r *JobRepository) Update(job *models.Job) error

func (*JobRepository) Upsert

func (r *JobRepository) Upsert(job *models.Job) error

type JobRepositoryInterface

type JobRepositoryInterface interface {
	Create(job *models.Job) error
	Update(job *models.Job) error
	Upsert(job *models.Job) error
	FindByID(id string) (*models.Job, error)
	List() ([]models.Job, error)
	Delete(id string) error
	DeleteOrganizedOlderThan(date time.Time) error
}

JobRepositoryInterface defines the contract for job database operations

type MovieRepository

type MovieRepository struct {
	// contains filtered or unexported fields
}

func NewMovieRepository

func NewMovieRepository(db *DB) *MovieRepository

func (*MovieRepository) Create

func (r *MovieRepository) Create(movie *models.Movie) error

func (*MovieRepository) Delete

func (r *MovieRepository) Delete(id string) error

func (*MovieRepository) FindByContentID

func (r *MovieRepository) FindByContentID(contentID string) (*models.Movie, error)

func (*MovieRepository) FindByID

func (r *MovieRepository) FindByID(id string) (*models.Movie, error)

func (*MovieRepository) List

func (r *MovieRepository) List(limit, offset int) ([]models.Movie, error)

func (*MovieRepository) Update

func (r *MovieRepository) Update(movie *models.Movie) error

func (*MovieRepository) Upsert

func (r *MovieRepository) Upsert(movie *models.Movie) (*models.Movie, error)

type MovieRepositoryInterface

type MovieRepositoryInterface interface {
	Create(movie *models.Movie) error
	Update(movie *models.Movie) error
	Upsert(movie *models.Movie) (*models.Movie, error)
	FindByID(id string) (*models.Movie, error)
	FindByContentID(contentID string) (*models.Movie, error)
	Delete(id string) error
	List(limit, offset int) ([]models.Movie, error)
}

MovieRepositoryInterface defines the contract for movie database operations

type MovieTagRepository

type MovieTagRepository struct {
	// contains filtered or unexported fields
}

MovieTagRepository handles movie tag operations

func NewMovieTagRepository

func NewMovieTagRepository(db *DB) *MovieTagRepository

NewMovieTagRepository creates a new movie tag repository

func (*MovieTagRepository) AddTag

func (r *MovieTagRepository) AddTag(movieID, tag string) error

AddTag adds a tag to a movie Returns error if tag already exists (UNIQUE constraint violation)

func (*MovieTagRepository) GetMoviesWithTag

func (r *MovieTagRepository) GetMoviesWithTag(tag string) ([]string, error)

GetMoviesWithTag returns all movie IDs that have the specified tag

func (*MovieTagRepository) GetTagsForMovie

func (r *MovieTagRepository) GetTagsForMovie(movieID string) ([]string, error)

GetTagsForMovie returns all tags for a specific movie

func (*MovieTagRepository) GetUniqueTagsList

func (r *MovieTagRepository) GetUniqueTagsList() ([]string, error)

GetUniqueTagsList returns all unique tags in the database

func (*MovieTagRepository) ListAll

func (r *MovieTagRepository) ListAll() (map[string][]string, error)

ListAll returns a map of all movie IDs to their tags

func (*MovieTagRepository) RemoveAllTags

func (r *MovieTagRepository) RemoveAllTags(movieID string) error

RemoveAllTags removes all tags for a movie

func (*MovieTagRepository) RemoveTag

func (r *MovieTagRepository) RemoveTag(movieID, tag string) error

RemoveTag removes a specific tag from a movie

type MovieTagRepositoryInterface

type MovieTagRepositoryInterface interface {
	AddTag(movieID, tag string) error
	RemoveTag(movieID, tag string) error
	RemoveAllTags(movieID string) error
	GetTagsForMovie(movieID string) ([]string, error)
	GetMoviesWithTag(tag string) ([]string, error)
	ListAll() (map[string][]string, error)
	GetUniqueTagsList() ([]string, error)
}

MovieTagRepositoryInterface defines the contract for movie tag operations

type MovieTranslationRepository

type MovieTranslationRepository struct {
	// contains filtered or unexported fields
}

func NewMovieTranslationRepository

func NewMovieTranslationRepository(db *DB) *MovieTranslationRepository

func (*MovieTranslationRepository) Delete

func (r *MovieTranslationRepository) Delete(movieID, language string) error

func (*MovieTranslationRepository) FindAllByMovie

func (r *MovieTranslationRepository) FindAllByMovie(movieID string) ([]models.MovieTranslation, error)

func (*MovieTranslationRepository) FindByMovieAndLanguage

func (r *MovieTranslationRepository) FindByMovieAndLanguage(movieID, language string) (*models.MovieTranslation, error)

func (*MovieTranslationRepository) Upsert

func (r *MovieTranslationRepository) Upsert(translation *models.MovieTranslation) error

func (*MovieTranslationRepository) UpsertTx

func (r *MovieTranslationRepository) UpsertTx(tx *gorm.DB, translation *models.MovieTranslation) error

type MovieTranslationRepositoryInterface

type MovieTranslationRepositoryInterface interface {
	Upsert(translation *models.MovieTranslation) error
	UpsertTx(tx *gorm.DB, translation *models.MovieTranslation) error
	FindByMovieAndLanguage(movieID, language string) (*models.MovieTranslation, error)
	FindAllByMovie(movieID string) ([]models.MovieTranslation, error)
	Delete(movieID, language string) error
}

MovieTranslationRepositoryInterface defines the contract for movie translation operations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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