Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeMigrationHash(content []byte) string
- func EnsureMigrationHashTable(db *sql.DB) error
- func GetStoredHash(db *sql.DB, name string) (string, error)
- func HashMatches(db *sql.DB, name string, content []byte) (bool, string, error)
- func IsNotFound(err error) bool
- func StoreMigrationHash(db *sql.DB, name, hash string) error
- type ActressAliasRepository
- func (r *ActressAliasRepository) Create(alias *models.ActressAlias) error
- func (r *ActressAliasRepository) Delete(aliasName string) error
- func (r *ActressAliasRepository) FindByAliasName(aliasName string) (*models.ActressAlias, error)
- func (r *ActressAliasRepository) FindByCanonicalName(canonicalName string) ([]models.ActressAlias, error)
- func (r *ActressAliasRepository) GetAliasMap() (map[string]string, error)
- func (r *ActressAliasRepository) List() ([]models.ActressAlias, error)
- func (r *ActressAliasRepository) Upsert(alias *models.ActressAlias) error
- type ActressAliasRepositoryInterface
- type ActressMergeConflict
- type ActressMergePreview
- type ActressMergeResult
- type ActressRepository
- func (r *ActressRepository) Count() (int64, error)
- func (r *ActressRepository) CountSearch(query string) (int64, error)
- func (r *ActressRepository) Create(actress *models.Actress) error
- func (r *ActressRepository) Delete(id uint) error
- func (r *ActressRepository) FindByID(id uint) (*models.Actress, error)
- func (r *ActressRepository) FindByJapaneseName(name string) (*models.Actress, error)
- func (r *ActressRepository) FindOrCreate(actress *models.Actress) error
- func (r *ActressRepository) List(limit, offset int) ([]models.Actress, error)
- func (r *ActressRepository) ListSorted(limit, offset int, sortBy, sortOrder string) ([]models.Actress, error)
- func (r *ActressRepository) Merge(targetID, sourceID uint, resolutions map[string]string) (*ActressMergeResult, error)
- func (r *ActressRepository) PreviewMerge(targetID, sourceID uint) (*ActressMergePreview, error)
- func (r *ActressRepository) Search(query string) ([]models.Actress, error)
- func (r *ActressRepository) SearchPaged(query string, limit, offset int) ([]models.Actress, error)
- func (r *ActressRepository) SearchPagedSorted(query string, limit, offset int, sortBy, sortOrder string) ([]models.Actress, error)
- func (r *ActressRepository) Update(actress *models.Actress) error
- type ActressRepositoryInterface
- type BaseRepoOption
- type BaseRepository
- func (r *BaseRepository[T, ID]) Count() (int64, error)
- func (r *BaseRepository[T, ID]) Create(entity *T) error
- func (r *BaseRepository[T, ID]) Delete(id ID) error
- func (r *BaseRepository[T, ID]) FindByID(id ID) (*T, error)
- func (r *BaseRepository[T, ID]) GetDB() *DB
- func (r *BaseRepository[T, ID]) List(limit, offset int) ([]T, error)
- func (r *BaseRepository[T, ID]) ListAll() ([]T, error)
- type BatchFileOperationRepository
- func (r *BatchFileOperationRepository) CountByBatchJobID(batchJobID string) (int64, error)
- func (r *BatchFileOperationRepository) CountByBatchJobIDAndRevertStatus(batchJobID string, status string) (int64, error)
- func (r *BatchFileOperationRepository) Create(op *models.BatchFileOperation) error
- func (r *BatchFileOperationRepository) CreateBatch(ops []*models.BatchFileOperation) error
- func (r *BatchFileOperationRepository) FindByBatchJobID(batchJobID string) ([]models.BatchFileOperation, error)
- func (r *BatchFileOperationRepository) FindByBatchJobIDAndRevertStatus(batchJobID string, revertStatus string) ([]models.BatchFileOperation, error)
- func (r *BatchFileOperationRepository) FindByID(id uint) (*models.BatchFileOperation, error)
- func (r *BatchFileOperationRepository) Update(op *models.BatchFileOperation) error
- func (r *BatchFileOperationRepository) UpdateRevertStatus(id uint, status string) error
- type BatchFileOperationRepositoryInterface
- type ContentIDMappingRepository
- func (r *ContentIDMappingRepository) Create(mapping *models.ContentIDMapping) error
- func (r *ContentIDMappingRepository) Delete(searchID string) error
- func (r *ContentIDMappingRepository) FindBySearchID(searchID string) (*models.ContentIDMapping, error)
- func (r *ContentIDMappingRepository) GetAll() ([]models.ContentIDMapping, error)
- type ContentIDMappingRepositoryInterface
- type DB
- type EventFilter
- type EventRepository
- func (r *EventRepository) Count() (int64, error)
- func (r *EventRepository) CountByDateRange(start, end time.Time) (int64, error)
- func (r *EventRepository) CountBySeverity(severity string) (int64, error)
- func (r *EventRepository) CountBySource(source string) (int64, error)
- func (r *EventRepository) CountByType(eventType string) (int64, error)
- func (r *EventRepository) CountByTypeAndSeverity(eventType, severity string) (int64, error)
- func (r *EventRepository) CountFiltered(filter EventFilter) (int64, error)
- func (r *EventRepository) CountGroupBySource() (map[string]int64, error)
- func (r *EventRepository) Create(event *models.Event) error
- func (r *EventRepository) DeleteOlderThan(date time.Time) error
- func (r *EventRepository) FindByDateRange(start, end time.Time, limit, offset int) ([]models.Event, error)
- func (r *EventRepository) FindByID(id uint) (*models.Event, error)
- func (r *EventRepository) FindBySeverity(severity string, limit, offset int) ([]models.Event, error)
- func (r *EventRepository) FindBySource(source string, limit, offset int) ([]models.Event, error)
- func (r *EventRepository) FindByType(eventType string, limit, offset int) ([]models.Event, error)
- func (r *EventRepository) FindByTypeAndSeverity(eventType, severity string, limit, offset int) ([]models.Event, error)
- func (r *EventRepository) FindFiltered(filter EventFilter, limit, offset int) ([]models.Event, error)
- func (r *EventRepository) List(limit, offset int) ([]models.Event, error)
- type EventRepositoryInterface
- type GenreReplacementRepository
- func (r *GenreReplacementRepository) Create(replacement *models.GenreReplacement) error
- func (r *GenreReplacementRepository) Delete(original string) error
- func (r *GenreReplacementRepository) FindByOriginal(original string) (*models.GenreReplacement, error)
- func (r *GenreReplacementRepository) GetReplacementMap() (map[string]string, error)
- func (r *GenreReplacementRepository) List() ([]models.GenreReplacement, error)
- func (r *GenreReplacementRepository) Upsert(replacement *models.GenreReplacement) error
- type GenreReplacementRepositoryInterface
- type GenreRepository
- type HistoryRepository
- func (r *HistoryRepository) Count() (int64, error)
- func (r *HistoryRepository) CountByOperation(operation string) (int64, error)
- func (r *HistoryRepository) CountByStatus(status string) (int64, error)
- func (r *HistoryRepository) Create(history *models.History) error
- func (r *HistoryRepository) Delete(id uint) error
- func (r *HistoryRepository) DeleteByMovieID(movieID string) error
- func (r *HistoryRepository) DeleteOlderThan(date time.Time) error
- func (r *HistoryRepository) FindByBatchJobID(batchJobID string) ([]models.History, error)
- func (r *HistoryRepository) FindByDateRange(start, end time.Time) ([]models.History, error)
- func (r *HistoryRepository) FindByID(id uint) (*models.History, error)
- func (r *HistoryRepository) FindByMovieID(movieID string) ([]models.History, error)
- func (r *HistoryRepository) FindByOperation(operation string, limit int) ([]models.History, error)
- func (r *HistoryRepository) FindByStatus(status string, limit int) ([]models.History, error)
- func (r *HistoryRepository) FindRecent(limit int) ([]models.History, error)
- func (r *HistoryRepository) List(limit, offset int) ([]models.History, error)
- type HistoryRepositoryInterface
- type JobRepository
- func (r *JobRepository) Create(job *models.Job) error
- func (r *JobRepository) Delete(id string) error
- func (r *JobRepository) DeleteOrganizedOlderThan(date time.Time) error
- func (r *JobRepository) FindByID(id string) (*models.Job, error)
- func (r *JobRepository) List() ([]models.Job, error)
- func (r *JobRepository) Update(job *models.Job) error
- func (r *JobRepository) Upsert(job *models.Job) error
- type JobRepositoryInterface
- type MovieRepository
- func (r *MovieRepository) Create(movie *models.Movie) error
- func (r *MovieRepository) Delete(id string) error
- func (r *MovieRepository) FindByContentID(contentID string) (*models.Movie, error)
- func (r *MovieRepository) FindByID(id string) (*models.Movie, error)
- func (r *MovieRepository) List(limit, offset int) ([]models.Movie, error)
- func (r *MovieRepository) Update(movie *models.Movie) error
- func (r *MovieRepository) Upsert(movie *models.Movie) (*models.Movie, error)
- type MovieRepositoryInterface
- type MovieTagRepository
- func (r *MovieTagRepository) AddTag(movieID, tag string) error
- func (r *MovieTagRepository) GetMoviesWithTag(tag string) ([]string, error)
- func (r *MovieTagRepository) GetTagsForMovie(movieID string) ([]string, error)
- func (r *MovieTagRepository) GetUniqueTagsList() ([]string, error)
- func (r *MovieTagRepository) ListAll() (map[string][]string, error)
- func (r *MovieTagRepository) RemoveAllTags(movieID string) error
- func (r *MovieTagRepository) RemoveTag(movieID, tag string) error
- type MovieTagRepositoryInterface
- type MovieTranslationRepository
- func (r *MovieTranslationRepository) Delete(movieID, language string) error
- func (r *MovieTranslationRepository) FindAllByMovie(movieID string) ([]models.MovieTranslation, error)
- func (r *MovieTranslationRepository) FindByMovieAndLanguage(movieID, language string) (*models.MovieTranslation, error)
- func (r *MovieTranslationRepository) Upsert(translation *models.MovieTranslation) error
- func (r *MovieTranslationRepository) UpsertTx(tx *gorm.DB, translation *models.MovieTranslation) error
- type MovieTranslationRepositoryInterface
Constants ¶
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 ¶
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") )
var ErrNotFound = errors.New("record not found")
Functions ¶
func ComputeMigrationHash ¶
func IsNotFound ¶
Types ¶
type ActressAliasRepository ¶
type ActressAliasRepository struct {
*BaseRepository[models.ActressAlias, uint]
}
func NewActressAliasRepository ¶
func NewActressAliasRepository(db *DB) *ActressAliasRepository
func (*ActressAliasRepository) Create ¶
func (r *ActressAliasRepository) Create(alias *models.ActressAlias) error
func (*ActressAliasRepository) Delete ¶
func (r *ActressAliasRepository) Delete(aliasName string) error
func (*ActressAliasRepository) FindByAliasName ¶
func (r *ActressAliasRepository) FindByAliasName(aliasName string) (*models.ActressAlias, error)
func (*ActressAliasRepository) FindByCanonicalName ¶
func (r *ActressAliasRepository) FindByCanonicalName(canonicalName string) ([]models.ActressAlias, error)
func (*ActressAliasRepository) GetAliasMap ¶
func (r *ActressAliasRepository) GetAliasMap() (map[string]string, error)
func (*ActressAliasRepository) List ¶
func (r *ActressAliasRepository) List() ([]models.ActressAlias, error)
func (*ActressAliasRepository) Upsert ¶
func (r *ActressAliasRepository) Upsert(alias *models.ActressAlias) error
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 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 ActressRepository ¶
type ActressRepository struct {
*BaseRepository[models.Actress, uint]
}
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 (*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 (*ActressRepository) SearchPagedSorted ¶
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 BaseRepoOption ¶
type BaseRepoOption[T any, ID string | uint] func(*BaseRepository[T, ID])
func WithDefaultOrder ¶
func WithDefaultOrder[T any, ID string | uint](order string) BaseRepoOption[T, ID]
func WithNewEntity ¶
func WithNewEntity[T any, ID string | uint](fn func() T) BaseRepoOption[T, ID]
type BaseRepository ¶
func NewBaseRepository ¶
func NewBaseRepository[T any, ID string | uint]( db *DB, entityName string, labelFunc func(t T) string, opts ...BaseRepoOption[T, ID], ) *BaseRepository[T, ID]
func (*BaseRepository[T, ID]) Count ¶
func (r *BaseRepository[T, ID]) Count() (int64, error)
func (*BaseRepository[T, ID]) Create ¶
func (r *BaseRepository[T, ID]) Create(entity *T) error
func (*BaseRepository[T, ID]) Delete ¶
func (r *BaseRepository[T, ID]) Delete(id ID) error
func (*BaseRepository[T, ID]) FindByID ¶
func (r *BaseRepository[T, ID]) FindByID(id ID) (*T, error)
func (*BaseRepository[T, ID]) GetDB ¶
func (r *BaseRepository[T, ID]) GetDB() *DB
func (*BaseRepository[T, ID]) List ¶
func (r *BaseRepository[T, ID]) List(limit, offset int) ([]T, error)
func (*BaseRepository[T, ID]) ListAll ¶
func (r *BaseRepository[T, ID]) ListAll() ([]T, error)
type BatchFileOperationRepository ¶
type BatchFileOperationRepository struct {
*BaseRepository[models.BatchFileOperation, uint]
}
func NewBatchFileOperationRepository ¶
func NewBatchFileOperationRepository(db *DB) *BatchFileOperationRepository
func (*BatchFileOperationRepository) CountByBatchJobID ¶
func (r *BatchFileOperationRepository) CountByBatchJobID(batchJobID string) (int64, error)
func (*BatchFileOperationRepository) CountByBatchJobIDAndRevertStatus ¶
func (r *BatchFileOperationRepository) CountByBatchJobIDAndRevertStatus(batchJobID string, status string) (int64, error)
func (*BatchFileOperationRepository) Create ¶
func (r *BatchFileOperationRepository) Create(op *models.BatchFileOperation) error
func (*BatchFileOperationRepository) CreateBatch ¶
func (r *BatchFileOperationRepository) CreateBatch(ops []*models.BatchFileOperation) error
func (*BatchFileOperationRepository) FindByBatchJobID ¶
func (r *BatchFileOperationRepository) FindByBatchJobID(batchJobID string) ([]models.BatchFileOperation, error)
func (*BatchFileOperationRepository) FindByBatchJobIDAndRevertStatus ¶
func (r *BatchFileOperationRepository) FindByBatchJobIDAndRevertStatus(batchJobID string, revertStatus string) ([]models.BatchFileOperation, error)
func (*BatchFileOperationRepository) FindByID ¶
func (r *BatchFileOperationRepository) FindByID(id uint) (*models.BatchFileOperation, error)
func (*BatchFileOperationRepository) Update ¶
func (r *BatchFileOperationRepository) Update(op *models.BatchFileOperation) error
func (*BatchFileOperationRepository) UpdateRevertStatus ¶
func (r *BatchFileOperationRepository) UpdateRevertStatus(id uint, status string) error
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 ¶
func (r *ContentIDMappingRepository) Create(mapping *models.ContentIDMapping) error
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 ¶
func (r *ContentIDMappingRepository) GetAll() ([]models.ContentIDMapping, error)
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 ¶
DB wraps the GORM database connection
func (*DB) AutoMigrate ¶
AutoMigrate runs startup database migrations.
Kept for backward compatibility in tests and existing call sites. New runtime paths should call RunMigrationsOnStartup directly.
func (*DB) RunMigrationsOnStartup ¶
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 {
*BaseRepository[models.Event, uint]
}
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) DeleteOlderThan ¶
func (r *EventRepository) DeleteOlderThan(date time.Time) error
func (*EventRepository) FindByDateRange ¶
func (*EventRepository) FindByID ¶
func (r *EventRepository) FindByID(id uint) (*models.Event, error)
func (*EventRepository) FindBySeverity ¶
func (*EventRepository) FindBySource ¶
func (*EventRepository) FindByType ¶
func (*EventRepository) FindByTypeAndSeverity ¶
func (*EventRepository) FindFiltered ¶
func (r *EventRepository) FindFiltered(filter EventFilter, 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 {
*BaseRepository[models.GenreReplacement, uint]
}
func NewGenreReplacementRepository ¶
func NewGenreReplacementRepository(db *DB) *GenreReplacementRepository
func (*GenreReplacementRepository) Create ¶
func (r *GenreReplacementRepository) Create(replacement *models.GenreReplacement) error
func (*GenreReplacementRepository) Delete ¶
func (r *GenreReplacementRepository) Delete(original string) error
func (*GenreReplacementRepository) FindByOriginal ¶
func (r *GenreReplacementRepository) FindByOriginal(original string) (*models.GenreReplacement, error)
func (*GenreReplacementRepository) GetReplacementMap ¶
func (r *GenreReplacementRepository) GetReplacementMap() (map[string]string, error)
func (*GenreReplacementRepository) List ¶
func (r *GenreReplacementRepository) List() ([]models.GenreReplacement, error)
func (*GenreReplacementRepository) Upsert ¶
func (r *GenreReplacementRepository) Upsert(replacement *models.GenreReplacement) error
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 {
*BaseRepository[models.Genre, uint]
}
func NewGenreRepository ¶
func NewGenreRepository(db *DB) *GenreRepository
func (*GenreRepository) FindOrCreate ¶
func (r *GenreRepository) FindOrCreate(name string) (*models.Genre, error)
type HistoryRepository ¶
type HistoryRepository struct {
*BaseRepository[models.History, uint]
}
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 (*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 (*HistoryRepository) FindByStatus ¶
func (*HistoryRepository) FindRecent ¶
func (r *HistoryRepository) FindRecent(limit 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 {
*BaseRepository[models.Job, string]
}
func NewJobRepository ¶
func NewJobRepository(db *DB) *JobRepository
func (*JobRepository) Delete ¶
func (r *JobRepository) Delete(id string) error
func (*JobRepository) DeleteOrganizedOlderThan ¶
func (r *JobRepository) DeleteOrganizedOlderThan(date time.Time) 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 {
*BaseRepository[models.Movie, string]
}
func NewMovieRepository ¶
func NewMovieRepository(db *DB) *MovieRepository
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)
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
Source Files
¶
- actress_alias_repo.go
- actress_merge.go
- actress_repo.go
- actress_sort.go
- base_repository.go
- batch_file_operation_repo.go
- content_id_mapping.go
- database.go
- errors.go
- event_repo.go
- genre_replacement_repo.go
- genre_repo.go
- helpers.go
- history_repo.go
- interfaces.go
- job_repository.go
- migrations_hash.go
- migrations_runner.go
- movie_repo.go
- movie_tag_repo.go
- movie_translation_repo.go
- movie_utils.go