Documentation ¶
Overview ¶
Package sqlite provides interfaces to interact with the sqlite database.
Index ¶
- Constants
- Variables
- func RegisterPostMigration(schemaVersion uint, fn customMigrationFunc)
- func RegisterPreMigration(schemaVersion uint, fn customMigrationFunc)
- type Anonymiser
- type BlobStore
- func (qb *BlobStore) Count(ctx context.Context) (int, error)
- func (qb *BlobStore) Delete(ctx context.Context, checksum string) error
- func (qb *BlobStore) EntryExists(ctx context.Context, checksum string) (bool, error)
- func (qb *BlobStore) FindBlobs(ctx context.Context, n uint, lastChecksum string) ([]string, error)
- func (qb *BlobStore) MigrateBlob(ctx context.Context, checksum string, deleteOld bool) error
- func (qb *BlobStore) Read(ctx context.Context, checksum string) ([]byte, error)
- func (qb *BlobStore) Write(ctx context.Context, data []byte) (string, error)
- type BlobStoreOptions
- type ChecksumBlobNotExistError
- type ChecksumNotFoundError
- type CustomSQLiteConn
- type CustomSQLiteDriver
- type Database
- func (db *Database) Analyze(ctx context.Context) error
- func (db *Database) Anonymise(outPath string) error
- func (db *Database) AnonymousDatabasePath(backupDirectoryPath string) string
- func (db *Database) AppSchemaVersion() uint
- func (db *Database) Backup(backupPath string) (err error)
- func (db *Database) Begin(ctx context.Context, writable bool) (context.Context, error)
- func (db *Database) Close() error
- func (db *Database) Commit(ctx context.Context) error
- func (db *Database) DatabaseBackupPath(backupDirectoryPath string) string
- func (db *Database) DatabasePath() string
- func (db *Database) ExecSQL(ctx context.Context, query string, args []interface{}) (*int64, *int64, error)
- func (db *Database) IsLocked(err error) bool
- func (db *Database) Open(dbPath string) error
- func (db *Database) Optimise(ctx context.Context) error
- func (db *Database) QuerySQL(ctx context.Context, query string, args []interface{}) ([]string, [][]interface{}, error)
- func (db *Database) ReInitialise() error
- func (db *Database) Ready() error
- func (db *Database) Remove() error
- func (db *Database) Repository() models.Repository
- func (db *Database) Reset() error
- func (db *Database) RestoreFromBackup(backupPath string) error
- func (db *Database) Rollback(ctx context.Context) error
- func (db *Database) RunAllMigrations() error
- func (db *Database) SetBlobStoreOptions(options BlobStoreOptions)
- func (db *Database) Vacuum(ctx context.Context) error
- func (db *Database) Version() uint
- func (db *Database) WithDatabase(ctx context.Context) (context.Context, error)
- type Date
- type FileStore
- func (qb *FileStore) CountAllInPaths(ctx context.Context, p []string) (int, error)
- func (qb *FileStore) CountByFolderID(ctx context.Context, folderID models.FolderID) (int, error)
- func (qb *FileStore) Create(ctx context.Context, f models.File) error
- func (qb *FileStore) Destroy(ctx context.Context, id models.FileID) error
- func (qb *FileStore) DestroyFingerprints(ctx context.Context, fileID models.FileID, types []string) error
- func (qb *FileStore) Find(ctx context.Context, ids ...models.FileID) ([]models.File, error)
- func (qb *FileStore) FindAllByPath(ctx context.Context, p string) ([]models.File, error)
- func (qb *FileStore) FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]models.File, error)
- func (qb *FileStore) FindByFileInfo(ctx context.Context, info fs.FileInfo, size int64) ([]models.File, error)
- func (qb *FileStore) FindByFingerprint(ctx context.Context, fp models.Fingerprint) ([]models.File, error)
- func (qb *FileStore) FindByPath(ctx context.Context, p string) (models.File, error)
- func (qb *FileStore) FindByZipFileID(ctx context.Context, zipFileID models.FileID) ([]models.File, error)
- func (qb *FileStore) GetCaptions(ctx context.Context, fileID models.FileID) ([]*models.VideoCaption, error)
- func (qb *FileStore) IsPrimary(ctx context.Context, fileID models.FileID) (bool, error)
- func (qb *FileStore) ModifyFingerprints(ctx context.Context, fileID models.FileID, fingerprints []models.Fingerprint) error
- func (qb *FileStore) Query(ctx context.Context, options models.FileQueryOptions) (*models.FileQueryResult, error)
- func (qb *FileStore) Update(ctx context.Context, f models.File) error
- func (qb *FileStore) UpdateCaptions(ctx context.Context, fileID models.FileID, captions []*models.VideoCaption) error
- type FolderStore
- func (qb *FolderStore) CountAllInPaths(ctx context.Context, p []string) (int, error)
- func (qb *FolderStore) Create(ctx context.Context, f *models.Folder) error
- func (qb *FolderStore) Destroy(ctx context.Context, id models.FolderID) error
- func (qb *FolderStore) Find(ctx context.Context, id models.FolderID) (*models.Folder, error)
- func (qb *FolderStore) FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]*models.Folder, error)
- func (qb *FolderStore) FindByParentFolderID(ctx context.Context, parentFolderID models.FolderID) ([]*models.Folder, error)
- func (qb *FolderStore) FindByPath(ctx context.Context, p string) (*models.Folder, error)
- func (qb *FolderStore) FindByZipFileID(ctx context.Context, zipFileID models.FileID) ([]*models.Folder, error)
- func (qb *FolderStore) Update(ctx context.Context, updatedObject *models.Folder) error
- type GalleryChapterStore
- func (qb *GalleryChapterStore) Create(ctx context.Context, newObject *models.GalleryChapter) error
- func (qb *GalleryChapterStore) Destroy(ctx context.Context, id int) error
- func (qb *GalleryChapterStore) Find(ctx context.Context, id int) (*models.GalleryChapter, error)
- func (qb *GalleryChapterStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.GalleryChapter, error)
- func (qb *GalleryChapterStore) FindMany(ctx context.Context, ids []int) ([]*models.GalleryChapter, error)
- func (qb *GalleryChapterStore) Update(ctx context.Context, updatedObject *models.GalleryChapter) error
- func (qb *GalleryChapterStore) UpdatePartial(ctx context.Context, id int, partial models.GalleryChapterPartial) (*models.GalleryChapter, error)
- type GalleryStore
- func (qb *GalleryStore) AddFileID(ctx context.Context, id int, fileID models.FileID) error
- func (qb *GalleryStore) AddImages(ctx context.Context, galleryID int, imageIDs ...int) error
- func (qb *GalleryStore) All(ctx context.Context) ([]*models.Gallery, error)
- func (qb *GalleryStore) Count(ctx context.Context) (int, error)
- func (qb *GalleryStore) CountByFileID(ctx context.Context, fileID models.FileID) (int, error)
- func (qb *GalleryStore) CountByImageID(ctx context.Context, imageID int) (int, error)
- func (qb *GalleryStore) Create(ctx context.Context, newObject *models.Gallery, fileIDs []models.FileID) error
- func (qb *GalleryStore) Destroy(ctx context.Context, id int) error
- func (qb *GalleryStore) Find(ctx context.Context, id int) (*models.Gallery, error)
- func (qb *GalleryStore) FindByChecksum(ctx context.Context, checksum string) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByChecksums(ctx context.Context, checksums []string) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByFileID(ctx context.Context, fileID models.FileID) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByFingerprints(ctx context.Context, fp []models.Fingerprint) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByFolderID(ctx context.Context, folderID models.FolderID) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByImageID(ctx context.Context, imageID int) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByPath(ctx context.Context, p string) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindBySceneID(ctx context.Context, sceneID int) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindMany(ctx context.Context, ids []int) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindUserGalleryByTitle(ctx context.Context, title string) ([]*models.Gallery, error)
- func (qb *GalleryStore) GetFiles(ctx context.Context, id int) ([]models.File, error)
- func (qb *GalleryStore) GetImageIDs(ctx context.Context, galleryID int) ([]int, error)
- func (qb *GalleryStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]models.FileID, error)
- func (qb *GalleryStore) GetPerformerIDs(ctx context.Context, id int) ([]int, error)
- func (qb *GalleryStore) GetSceneIDs(ctx context.Context, id int) ([]int, error)
- func (qb *GalleryStore) GetTagIDs(ctx context.Context, id int) ([]int, error)
- func (qb *GalleryStore) GetURLs(ctx context.Context, galleryID int) ([]string, error)
- func (qb *GalleryStore) Query(ctx context.Context, galleryFilter *models.GalleryFilterType, ...) ([]*models.Gallery, int, error)
- func (qb *GalleryStore) QueryCount(ctx context.Context, galleryFilter *models.GalleryFilterType, ...) (int, error)
- func (qb *GalleryStore) RemoveImages(ctx context.Context, galleryID int, imageIDs ...int) error
- func (qb *GalleryStore) ResetCover(ctx context.Context, galleryID int) error
- func (qb *GalleryStore) SetCover(ctx context.Context, galleryID int, coverImageID int) error
- func (qb *GalleryStore) Update(ctx context.Context, updatedObject *models.Gallery) error
- func (qb *GalleryStore) UpdateImages(ctx context.Context, galleryID int, imageIDs []int) error
- func (qb *GalleryStore) UpdatePartial(ctx context.Context, id int, partial models.GalleryPartial) (*models.Gallery, error)
- type GroupStore
- func (s *GroupStore) AddSubGroups(ctx context.Context, groupID int, subGroups []models.GroupIDDescription, ...) error
- func (qb *GroupStore) All(ctx context.Context) ([]*models.Group, error)
- func (qb *GroupStore) Count(ctx context.Context) (int, error)
- func (qb *GroupStore) CountByPerformerID(ctx context.Context, performerID int) (int, error)
- func (qb *GroupStore) CountByStudioID(ctx context.Context, studioID int) (int, error)
- func (s *GroupStore) CountByTagID(ctx context.Context, tagID int) (int, error)
- func (qb *GroupStore) Create(ctx context.Context, newObject *models.Group) error
- func (qb *GroupStore) Destroy(ctx context.Context, id int) error
- func (qb *GroupStore) DestroyImage(ctx context.Context, id int, blobCol string) error
- func (qb *GroupStore) Find(ctx context.Context, id int) (*models.Group, error)
- func (qb *GroupStore) FindByName(ctx context.Context, name string, nocase bool) (*models.Group, error)
- func (qb *GroupStore) FindByNames(ctx context.Context, names []string, nocase bool) ([]*models.Group, error)
- func (qb *GroupStore) FindByPerformerID(ctx context.Context, performerID int) ([]*models.Group, error)
- func (qb *GroupStore) FindByStudioID(ctx context.Context, studioID int) ([]*models.Group, error)
- func (qb *GroupStore) FindInAncestors(ctx context.Context, ascestorIDs []int, ids []int) ([]int, error)
- func (qb *GroupStore) FindMany(ctx context.Context, ids []int) ([]*models.Group, error)
- func (qb *GroupStore) FindSubGroupIDs(ctx context.Context, containingID int, ids []int) ([]int, error)
- func (qb *GroupStore) GetBackImage(ctx context.Context, groupID int) ([]byte, error)
- func (s *GroupStore) GetContainingGroupDescriptions(ctx context.Context, id int) ([]models.GroupIDDescription, error)
- func (qb *GroupStore) GetFrontImage(ctx context.Context, groupID int) ([]byte, error)
- func (qb *GroupStore) GetImage(ctx context.Context, id int, blobCol string) ([]byte, error)
- func (s *GroupStore) GetSubGroupDescriptions(ctx context.Context, id int) ([]models.GroupIDDescription, error)
- func (s *GroupStore) GetTagIDs(ctx context.Context, id int) ([]int, error)
- func (qb *GroupStore) GetURLs(ctx context.Context, groupID int) ([]string, error)
- func (qb *GroupStore) HasBackImage(ctx context.Context, groupID int) (bool, error)
- func (qb *GroupStore) HasFrontImage(ctx context.Context, groupID int) (bool, error)
- func (qb *GroupStore) HasImage(ctx context.Context, id int, blobCol string) (bool, error)
- func (qb *GroupStore) Query(ctx context.Context, groupFilter *models.GroupFilterType, ...) ([]*models.Group, int, error)
- func (qb *GroupStore) QueryCount(ctx context.Context, groupFilter *models.GroupFilterType, ...) (int, error)
- func (s *GroupStore) RemoveSubGroups(ctx context.Context, groupID int, subGroupIDs []int) error
- func (s *GroupStore) ReorderSubGroups(ctx context.Context, groupID int, subGroupIDs []int, insertPointID int, ...) error
- func (qb *GroupStore) Update(ctx context.Context, updatedObject *models.Group) error
- func (qb *GroupStore) UpdateBackImage(ctx context.Context, groupID int, backImage []byte) error
- func (qb *GroupStore) UpdateFrontImage(ctx context.Context, groupID int, frontImage []byte) error
- func (qb *GroupStore) UpdateImage(ctx context.Context, id int, blobCol string, image []byte) error
- func (qb *GroupStore) UpdatePartial(ctx context.Context, id int, partial models.GroupPartial) (*models.Group, error)
- type ImageStore
- func (qb *ImageStore) AddFileID(ctx context.Context, id int, fileID models.FileID) error
- func (qb *ImageStore) All(ctx context.Context) ([]*models.Image, error)
- func (qb *ImageStore) Count(ctx context.Context) (int, error)
- func (qb *ImageStore) CountByFileID(ctx context.Context, fileID models.FileID) (int, error)
- func (qb *ImageStore) CountByGalleryID(ctx context.Context, galleryID int) (int, error)
- func (qb *ImageStore) CoverByGalleryID(ctx context.Context, galleryID int) (*models.Image, error)
- func (qb *ImageStore) Create(ctx context.Context, newObject *models.Image, fileIDs []models.FileID) error
- func (qb *ImageStore) DecrementOCounter(ctx context.Context, id int) (int, error)
- func (qb *ImageStore) Destroy(ctx context.Context, id int) error
- func (qb *ImageStore) Find(ctx context.Context, id int) (*models.Image, error)
- func (qb *ImageStore) FindByChecksum(ctx context.Context, checksum string) ([]*models.Image, error)
- func (qb *ImageStore) FindByFileID(ctx context.Context, fileID models.FileID) ([]*models.Image, error)
- func (qb *ImageStore) FindByFingerprints(ctx context.Context, fp []models.Fingerprint) ([]*models.Image, error)
- func (qb *ImageStore) FindByFolderID(ctx context.Context, folderID models.FolderID) ([]*models.Image, error)
- func (qb *ImageStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.Image, error)
- func (qb *ImageStore) FindByGalleryIDIndex(ctx context.Context, galleryID int, index uint) (*models.Image, error)
- func (qb *ImageStore) FindByZipFileID(ctx context.Context, zipFileID models.FileID) ([]*models.Image, error)
- func (qb *ImageStore) FindMany(ctx context.Context, ids []int) ([]*models.Image, error)
- func (qb *ImageStore) GetFiles(ctx context.Context, id int) ([]models.File, error)
- func (qb *ImageStore) GetGalleryIDs(ctx context.Context, imageID int) ([]int, error)
- func (qb *ImageStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]models.FileID, error)
- func (qb *ImageStore) GetPerformerIDs(ctx context.Context, imageID int) ([]int, error)
- func (qb *ImageStore) GetTagIDs(ctx context.Context, imageID int) ([]int, error)
- func (qb *ImageStore) GetURLs(ctx context.Context, imageID int) ([]string, error)
- func (qb *ImageStore) IncrementOCounter(ctx context.Context, id int) (int, error)
- func (qb *ImageStore) OCount(ctx context.Context) (int, error)
- func (qb *ImageStore) OCountByPerformerID(ctx context.Context, performerID int) (int, error)
- func (qb *ImageStore) Query(ctx context.Context, options models.ImageQueryOptions) (*models.ImageQueryResult, error)
- func (qb *ImageStore) QueryCount(ctx context.Context, imageFilter *models.ImageFilterType, ...) (int, error)
- func (qb *ImageStore) RemoveFileID(ctx context.Context, id int, fileID models.FileID) error
- func (qb *ImageStore) ResetOCounter(ctx context.Context, id int) (int, error)
- func (qb *ImageStore) Size(ctx context.Context) (float64, error)
- func (qb *ImageStore) Update(ctx context.Context, updatedObject *models.Image) error
- func (qb *ImageStore) UpdatePartial(ctx context.Context, id int, partial models.ImagePartial) (*models.Image, error)
- func (qb *ImageStore) UpdatePerformers(ctx context.Context, imageID int, performerIDs []int) error
- func (qb *ImageStore) UpdateTags(ctx context.Context, imageID int, tagIDs []int) error
- type MigrationNeededError
- type Migrator
- type MismatchedSchemaVersionError
- type NotFoundError
- type NullDate
- type NullTimestamp
- type PerformerStore
- func (qb *PerformerStore) All(ctx context.Context) ([]*models.Performer, error)
- func (qb *PerformerStore) Count(ctx context.Context) (int, error)
- func (qb *PerformerStore) CountByTagID(ctx context.Context, tagID int) (int, error)
- func (qb *PerformerStore) Create(ctx context.Context, newObject *models.Performer) error
- func (qb *PerformerStore) Destroy(ctx context.Context, id int) error
- func (qb *PerformerStore) DestroyImage(ctx context.Context, id int, blobCol string) error
- func (qb *PerformerStore) Find(ctx context.Context, id int) (*models.Performer, error)
- func (qb *PerformerStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.Performer, error)
- func (qb *PerformerStore) FindByImageID(ctx context.Context, imageID int) ([]*models.Performer, error)
- func (qb *PerformerStore) FindByNames(ctx context.Context, names []string, nocase bool) ([]*models.Performer, error)
- func (qb *PerformerStore) FindBySceneID(ctx context.Context, sceneID int) ([]*models.Performer, error)
- func (qb *PerformerStore) FindByStashID(ctx context.Context, stashID models.StashID) ([]*models.Performer, error)
- func (qb *PerformerStore) FindByStashIDStatus(ctx context.Context, hasStashID bool, stashboxEndpoint string) ([]*models.Performer, error)
- func (qb *PerformerStore) FindMany(ctx context.Context, ids []int) ([]*models.Performer, error)
- func (qb *PerformerStore) GetAliases(ctx context.Context, performerID int) ([]string, error)
- func (qb *PerformerStore) GetImage(ctx context.Context, performerID int) ([]byte, error)
- func (qb *PerformerStore) GetStashIDs(ctx context.Context, performerID int) ([]models.StashID, error)
- func (qb *PerformerStore) GetTagIDs(ctx context.Context, id int) ([]int, error)
- func (qb *PerformerStore) GetURLs(ctx context.Context, performerID int) ([]string, error)
- func (qb *PerformerStore) HasImage(ctx context.Context, performerID int) (bool, error)
- func (qb *PerformerStore) Query(ctx context.Context, performerFilter *models.PerformerFilterType, ...) ([]*models.Performer, int, error)
- func (qb *PerformerStore) QueryCount(ctx context.Context, performerFilter *models.PerformerFilterType, ...) (int, error)
- func (qb *PerformerStore) QueryForAutoTag(ctx context.Context, words []string) ([]*models.Performer, error)
- func (qb *PerformerStore) Update(ctx context.Context, updatedObject *models.Performer) error
- func (qb *PerformerStore) UpdateImage(ctx context.Context, performerID int, image []byte) error
- func (qb *PerformerStore) UpdatePartial(ctx context.Context, id int, partial models.PerformerPartial) (*models.Performer, error)
- type SavedFilterStore
- func (qb *SavedFilterStore) All(ctx context.Context) ([]*models.SavedFilter, error)
- func (qb *SavedFilterStore) Create(ctx context.Context, newObject *models.SavedFilter) error
- func (qb *SavedFilterStore) Destroy(ctx context.Context, id int) error
- func (qb *SavedFilterStore) Find(ctx context.Context, id int) (*models.SavedFilter, error)
- func (qb *SavedFilterStore) FindByMode(ctx context.Context, mode models.FilterMode) ([]*models.SavedFilter, error)
- func (qb *SavedFilterStore) FindMany(ctx context.Context, ids []int, ignoreNotFound bool) ([]*models.SavedFilter, error)
- func (qb *SavedFilterStore) Update(ctx context.Context, updatedObject *models.SavedFilter) error
- type SceneMarkerStore
- func (qb *SceneMarkerStore) All(ctx context.Context) ([]*models.SceneMarker, error)
- func (qb *SceneMarkerStore) Count(ctx context.Context) (int, error)
- func (qb *SceneMarkerStore) CountByTagID(ctx context.Context, tagID int) (int, error)
- func (qb *SceneMarkerStore) Create(ctx context.Context, newObject *models.SceneMarker) error
- func (qb *SceneMarkerStore) Destroy(ctx context.Context, id int) error
- func (qb *SceneMarkerStore) Find(ctx context.Context, id int) (*models.SceneMarker, error)
- func (qb *SceneMarkerStore) FindBySceneID(ctx context.Context, sceneID int) ([]*models.SceneMarker, error)
- func (qb *SceneMarkerStore) FindMany(ctx context.Context, ids []int) ([]*models.SceneMarker, error)
- func (qb *SceneMarkerStore) GetMarkerStrings(ctx context.Context, q *string, sort *string) ([]*models.MarkerStringsResultType, error)
- func (qb *SceneMarkerStore) GetTagIDs(ctx context.Context, id int) ([]int, error)
- func (qb *SceneMarkerStore) Query(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, ...) ([]*models.SceneMarker, int, error)
- func (qb *SceneMarkerStore) QueryCount(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, ...) (int, error)
- func (qb *SceneMarkerStore) Update(ctx context.Context, updatedObject *models.SceneMarker) error
- func (qb *SceneMarkerStore) UpdatePartial(ctx context.Context, id int, partial models.SceneMarkerPartial) (*models.SceneMarker, error)
- func (qb *SceneMarkerStore) UpdateTags(ctx context.Context, id int, tagIDs []int) error
- func (qb *SceneMarkerStore) Wall(ctx context.Context, q *string) ([]*models.SceneMarker, error)
- type SceneStore
- func (qb *SceneStore) AddFileID(ctx context.Context, id int, fileID models.FileID) error
- func (qb *SceneStore) AddGalleryIDs(ctx context.Context, sceneID int, galleryIDs []int) error
- func (qb *SceneStore) AddO(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
- func (qb *SceneStore) AddViews(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
- func (qb *SceneStore) All(ctx context.Context) ([]*models.Scene, error)
- func (qb *SceneStore) AssignFiles(ctx context.Context, sceneID int, fileIDs []models.FileID) error
- func (qb *SceneStore) Count(ctx context.Context) (int, error)
- func (qb *SceneStore) CountAllViews(ctx context.Context) (int, error)
- func (qb *SceneStore) CountByFileID(ctx context.Context, fileID models.FileID) (int, error)
- func (qb *SceneStore) CountByPerformerID(ctx context.Context, performerID int) (int, error)
- func (qb *SceneStore) CountByStudioID(ctx context.Context, studioID int) (int, error)
- func (qb *SceneStore) CountMissingChecksum(ctx context.Context) (int, error)
- func (qb *SceneStore) CountMissingOSHash(ctx context.Context) (int, error)
- func (qb *SceneStore) CountUniqueViews(ctx context.Context) (int, error)
- func (qb *SceneStore) CountViews(ctx context.Context, id int) (int, error)
- func (qb *SceneStore) Create(ctx context.Context, newObject *models.Scene, fileIDs []models.FileID) error
- func (qb *SceneStore) DeleteAllViews(ctx context.Context, id int) (int, error)
- func (qb *SceneStore) DeleteO(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
- func (qb *SceneStore) DeleteViews(ctx context.Context, id int, dates []time.Time) ([]time.Time, error)
- func (qb *SceneStore) Destroy(ctx context.Context, id int) error
- func (qb *SceneStore) DestroyImage(ctx context.Context, id int, blobCol string) error
- func (qb *SceneStore) Duration(ctx context.Context) (float64, error)
- func (qb *SceneStore) Find(ctx context.Context, id int) (*models.Scene, error)
- func (qb *SceneStore) FindByChecksum(ctx context.Context, checksum string) ([]*models.Scene, error)
- func (qb *SceneStore) FindByFileID(ctx context.Context, fileID models.FileID) ([]*models.Scene, error)
- func (qb *SceneStore) FindByFingerprints(ctx context.Context, fp []models.Fingerprint) ([]*models.Scene, error)
- func (qb *SceneStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.Scene, error)
- func (qb *SceneStore) FindByGroupID(ctx context.Context, groupID int) ([]*models.Scene, error)
- func (qb *SceneStore) FindByOSHash(ctx context.Context, oshash string) ([]*models.Scene, error)
- func (qb *SceneStore) FindByPath(ctx context.Context, p string) ([]*models.Scene, error)
- func (qb *SceneStore) FindByPerformerID(ctx context.Context, performerID int) ([]*models.Scene, error)
- func (qb *SceneStore) FindByPrimaryFileID(ctx context.Context, fileID models.FileID) ([]*models.Scene, error)
- func (qb *SceneStore) FindDuplicates(ctx context.Context, distance int, durationDiff float64) ([][]*models.Scene, error)
- func (qb *SceneStore) FindMany(ctx context.Context, ids []int) ([]*models.Scene, error)
- func (qb *SceneStore) GetAllOCount(ctx context.Context) (int, error)
- func (qb *SceneStore) GetCover(ctx context.Context, sceneID int) ([]byte, error)
- func (qb *SceneStore) GetFiles(ctx context.Context, id int) ([]*models.VideoFile, error)
- func (qb *SceneStore) GetGalleryIDs(ctx context.Context, id int) ([]int, error)
- func (qb *SceneStore) GetGroups(ctx context.Context, id int) (ret []models.GroupsScenes, err error)
- func (qb *SceneStore) GetImage(ctx context.Context, id int, blobCol string) ([]byte, error)
- func (qb *SceneStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]models.FileID, error)
- func (qb *SceneStore) GetManyLastViewed(ctx context.Context, ids []int) ([]*time.Time, error)
- func (qb *SceneStore) GetManyOCount(ctx context.Context, ids []int) ([]int, error)
- func (qb *SceneStore) GetManyODates(ctx context.Context, ids []int) ([][]time.Time, error)
- func (qb *SceneStore) GetManyViewCount(ctx context.Context, ids []int) ([]int, error)
- func (qb *SceneStore) GetManyViewDates(ctx context.Context, ids []int) ([][]time.Time, error)
- func (qb *SceneStore) GetOCount(ctx context.Context, id int) (int, error)
- func (qb *SceneStore) GetODates(ctx context.Context, id int) ([]time.Time, error)
- func (qb *SceneStore) GetPerformerIDs(ctx context.Context, id int) ([]int, error)
- func (qb *SceneStore) GetStashIDs(ctx context.Context, sceneID int) ([]models.StashID, error)
- func (qb *SceneStore) GetTagIDs(ctx context.Context, id int) ([]int, error)
- func (qb *SceneStore) GetURLs(ctx context.Context, sceneID int) ([]string, error)
- func (qb *SceneStore) GetUniqueOCount(ctx context.Context) (int, error)
- func (qb *SceneStore) GetViewDates(ctx context.Context, id int) ([]time.Time, error)
- func (qb *SceneStore) HasCover(ctx context.Context, sceneID int) (bool, error)
- func (qb *SceneStore) HasImage(ctx context.Context, id int, blobCol string) (bool, error)
- func (qb *SceneStore) LastView(ctx context.Context, id int) (*time.Time, error)
- func (qb *SceneStore) OCountByPerformerID(ctx context.Context, performerID int) (int, error)
- func (qb *SceneStore) PlayDuration(ctx context.Context) (float64, error)
- func (qb *SceneStore) Query(ctx context.Context, options models.SceneQueryOptions) (*models.SceneQueryResult, error)
- func (qb *SceneStore) QueryCount(ctx context.Context, sceneFilter *models.SceneFilterType, ...) (int, error)
- func (qb *SceneStore) ResetActivity(ctx context.Context, id int, resetResume bool, resetDuration bool) (bool, error)
- func (qb *SceneStore) ResetO(ctx context.Context, id int) (int, error)
- func (qb *SceneStore) SaveActivity(ctx context.Context, id int, resumeTime *float64, playDuration *float64) (bool, error)
- func (qb *SceneStore) Size(ctx context.Context) (float64, error)
- func (qb *SceneStore) Update(ctx context.Context, updatedObject *models.Scene) error
- func (qb *SceneStore) UpdateCover(ctx context.Context, sceneID int, image []byte) error
- func (qb *SceneStore) UpdateImage(ctx context.Context, id int, blobCol string, image []byte) error
- func (qb *SceneStore) UpdatePartial(ctx context.Context, id int, partial models.ScenePartial) (*models.Scene, error)
- func (qb *SceneStore) Wall(ctx context.Context, q *string) ([]*models.Scene, error)
- type StudioStore
- func (qb *StudioStore) All(ctx context.Context) ([]*models.Studio, error)
- func (qb *StudioStore) Count(ctx context.Context) (int, error)
- func (s *StudioStore) CountByTagID(ctx context.Context, tagID int) (int, error)
- func (qb *StudioStore) Create(ctx context.Context, newObject *models.Studio) error
- func (qb *StudioStore) Destroy(ctx context.Context, id int) error
- func (qb *StudioStore) DestroyImage(ctx context.Context, id int, blobCol string) error
- func (qb *StudioStore) Find(ctx context.Context, id int) (*models.Studio, error)
- func (qb *StudioStore) FindByName(ctx context.Context, name string, nocase bool) (*models.Studio, error)
- func (qb *StudioStore) FindBySceneID(ctx context.Context, sceneID int) (*models.Studio, error)
- func (qb *StudioStore) FindByStashID(ctx context.Context, stashID models.StashID) ([]*models.Studio, error)
- func (qb *StudioStore) FindByStashIDStatus(ctx context.Context, hasStashID bool, stashboxEndpoint string) ([]*models.Studio, error)
- func (qb *StudioStore) FindChildren(ctx context.Context, id int) ([]*models.Studio, error)
- func (qb *StudioStore) FindMany(ctx context.Context, ids []int) ([]*models.Studio, error)
- func (qb *StudioStore) GetAliases(ctx context.Context, studioID int) ([]string, error)
- func (qb *StudioStore) GetImage(ctx context.Context, studioID int) ([]byte, error)
- func (qb *StudioStore) GetStashIDs(ctx context.Context, studioID int) ([]models.StashID, error)
- func (s *StudioStore) GetTagIDs(ctx context.Context, id int) ([]int, error)
- func (qb *StudioStore) HasImage(ctx context.Context, studioID int) (bool, error)
- func (qb *StudioStore) Query(ctx context.Context, studioFilter *models.StudioFilterType, ...) ([]*models.Studio, int, error)
- func (qb *StudioStore) QueryCount(ctx context.Context, studioFilter *models.StudioFilterType, ...) (int, error)
- func (qb *StudioStore) QueryForAutoTag(ctx context.Context, words []string) ([]*models.Studio, error)
- func (qb *StudioStore) Update(ctx context.Context, updatedObject *models.Studio) error
- func (qb *StudioStore) UpdateImage(ctx context.Context, studioID int, image []byte) error
- func (qb *StudioStore) UpdatePartial(ctx context.Context, input models.StudioPartial) (*models.Studio, error)
- type TagStore
- func (qb *TagStore) All(ctx context.Context) ([]*models.Tag, error)
- func (qb *TagStore) Count(ctx context.Context) (int, error)
- func (qb *TagStore) CountByChildTagID(ctx context.Context, childID int) (int, error)
- func (qb *TagStore) CountByParentTagID(ctx context.Context, parentID int) (int, error)
- func (qb *TagStore) Create(ctx context.Context, newObject *models.Tag) error
- func (qb *TagStore) Destroy(ctx context.Context, id int) error
- func (qb *TagStore) DestroyImage(ctx context.Context, id int, blobCol string) error
- func (qb *TagStore) Find(ctx context.Context, id int) (*models.Tag, error)
- func (qb *TagStore) FindAllAncestors(ctx context.Context, tagID int, excludeIDs []int) ([]*models.TagPath, error)
- func (qb *TagStore) FindAllDescendants(ctx context.Context, tagID int, excludeIDs []int) ([]*models.TagPath, error)
- func (qb *TagStore) FindByChildTagID(ctx context.Context, parentID int) ([]*models.Tag, error)
- func (qb *TagStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.Tag, error)
- func (qb *TagStore) FindByGroupID(ctx context.Context, groupID int) ([]*models.Tag, error)
- func (qb *TagStore) FindByImageID(ctx context.Context, imageID int) ([]*models.Tag, error)
- func (qb *TagStore) FindByName(ctx context.Context, name string, nocase bool) (*models.Tag, error)
- func (qb *TagStore) FindByNames(ctx context.Context, names []string, nocase bool) ([]*models.Tag, error)
- func (qb *TagStore) FindByParentTagID(ctx context.Context, parentID int) ([]*models.Tag, error)
- func (qb *TagStore) FindByPerformerID(ctx context.Context, performerID int) ([]*models.Tag, error)
- func (qb *TagStore) FindBySceneID(ctx context.Context, sceneID int) ([]*models.Tag, error)
- func (qb *TagStore) FindBySceneMarkerID(ctx context.Context, sceneMarkerID int) ([]*models.Tag, error)
- func (qb *TagStore) FindByStudioID(ctx context.Context, studioID int) ([]*models.Tag, error)
- func (qb *TagStore) FindMany(ctx context.Context, ids []int) ([]*models.Tag, error)
- func (qb *TagStore) GetAliases(ctx context.Context, tagID int) ([]string, error)
- func (qb *TagStore) GetChildIDs(ctx context.Context, relatedID int) ([]int, error)
- func (qb *TagStore) GetImage(ctx context.Context, tagID int) ([]byte, error)
- func (qb *TagStore) GetParentIDs(ctx context.Context, relatedID int) ([]int, error)
- func (qb *TagStore) HasImage(ctx context.Context, tagID int) (bool, error)
- func (qb *TagStore) Merge(ctx context.Context, source []int, destination int) error
- func (qb *TagStore) Query(ctx context.Context, tagFilter *models.TagFilterType, ...) ([]*models.Tag, int, error)
- func (qb *TagStore) QueryForAutoTag(ctx context.Context, words []string) ([]*models.Tag, error)
- func (qb *TagStore) Update(ctx context.Context, updatedObject *models.Tag) error
- func (qb *TagStore) UpdateAliases(ctx context.Context, tagID int, aliases []string) error
- func (qb *TagStore) UpdateChildTags(ctx context.Context, tagID int, childIDs []int) error
- func (qb *TagStore) UpdateImage(ctx context.Context, tagID int, image []byte) error
- func (qb *TagStore) UpdateParentTags(ctx context.Context, tagID int, parentIDs []int) error
- func (qb *TagStore) UpdatePartial(ctx context.Context, id int, partial models.TagPartial) (*models.Tag, error)
- type Timestamp
- type UTCTimestamp
Constants ¶
const TimestampFormat = time.RFC3339
Variables ¶
var ( // ErrDatabaseNotInitialized indicates that the database is not // initialized, usually due to an incomplete configuration. ErrDatabaseNotInitialized = errors.New("database not initialized") )
var FingerprintReaderWriter = &fingerprintQueryBuilder{
repository: repository{
tableName: fingerprintTable,
idColumn: fileIDColumn,
},
tableMgr: fingerprintTableMgr,
}
Functions ¶
func RegisterPostMigration ¶ added in v0.17.0
func RegisterPostMigration(schemaVersion uint, fn customMigrationFunc)
func RegisterPreMigration ¶ added in v0.17.0
func RegisterPreMigration(schemaVersion uint, fn customMigrationFunc)
Types ¶
type Anonymiser ¶ added in v0.19.0
type Anonymiser struct {
*Database
}
func NewAnonymiser ¶ added in v0.19.0
func NewAnonymiser(db *Database, outPath string) (*Anonymiser, error)
type BlobStore ¶ added in v0.20.0
type BlobStore struct {
// contains filtered or unexported fields
}
func NewBlobStore ¶ added in v0.20.0
func NewBlobStore(options BlobStoreOptions) *BlobStore
func (*BlobStore) Delete ¶ added in v0.20.0
Delete marks a checksum as no longer in use by a single reference. If no references remain, the blob is deleted from the database and filesystem.
func (*BlobStore) EntryExists ¶ added in v0.25.0
func (*BlobStore) MigrateBlob ¶ added in v0.20.0
MigrateBlob migrates a blob from the filesystem to the database, or vice versa. The target is determined by the UseDatabase and UseFilesystem options. If deleteOld is true, the blob is deleted from the source after migration.
type BlobStoreOptions ¶ added in v0.20.0
type BlobStoreOptions struct { // UseFilesystem should be true if blob data should be stored in the filesystem UseFilesystem bool // UseDatabase should be true if blob data should be stored in the database UseDatabase bool // Path is the filesystem path to use for storing blobs Path string // SupplementaryPaths are alternative filesystem paths that will be used to find blobs // No changes will be made to these filesystems SupplementaryPaths []string }
type ChecksumBlobNotExistError ¶ added in v0.20.0
type ChecksumBlobNotExistError struct {
Checksum string
}
func (*ChecksumBlobNotExistError) Error ¶ added in v0.20.0
func (e *ChecksumBlobNotExistError) Error() string
type ChecksumNotFoundError ¶ added in v0.20.0
type ChecksumNotFoundError struct {
Checksum string
}
func (*ChecksumNotFoundError) Error ¶ added in v0.20.0
func (e *ChecksumNotFoundError) Error() string
type CustomSQLiteConn ¶ added in v0.20.0
type CustomSQLiteConn struct {
*sqlite3.SQLiteConn
}
func (*CustomSQLiteConn) Close ¶ added in v0.20.0
func (c *CustomSQLiteConn) Close() error
type CustomSQLiteDriver ¶ added in v0.20.0
type CustomSQLiteDriver struct{}
type Database ¶ added in v0.17.0
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶ added in v0.17.0
func NewDatabase() *Database
func (*Database) Analyze ¶ added in v0.22.0
Analyze runs an ANALYZE on the database to improve query performance.
func (*Database) AnonymousDatabasePath ¶ added in v0.19.0
func (*Database) AppSchemaVersion ¶ added in v0.17.0
func (*Database) Backup ¶ added in v0.17.0
Backup the database. If db is nil, then uses the existing database connection.
func (*Database) DatabaseBackupPath ¶ added in v0.17.0
func (*Database) DatabasePath ¶ added in v0.17.0
func (*Database) Open ¶ added in v0.17.0
Open initializes the database. If the database is new, then it performs a full migration to the latest schema version. Otherwise, any necessary migrations must be run separately using RunMigrations. Returns true if the database is new.
func (*Database) ReInitialise ¶ added in v0.26.0
func (*Database) Ready ¶ added in v0.17.0
Ready returns an error if the database is not ready to begin transactions.
func (*Database) Repository ¶ added in v0.24.0
func (db *Database) Repository() models.Repository
func (*Database) RestoreFromBackup ¶ added in v0.17.0
func (*Database) RunAllMigrations ¶ added in v0.26.0
RunAllMigrations runs all migrations to bring the database up to the current schema version
func (*Database) SetBlobStoreOptions ¶ added in v0.20.0
func (db *Database) SetBlobStoreOptions(options BlobStoreOptions)
type Date ¶ added in v0.22.0
Date represents a date stored as "YYYY-MM-DD"
type FileStore ¶ added in v0.17.0
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶ added in v0.17.0
func NewFileStore() *FileStore
func (*FileStore) CountAllInPaths ¶ added in v0.17.0
CountAllInPaths returns a count of all files that are within any of the given paths. Returns count of all files if p is empty.
func (*FileStore) CountByFolderID ¶ added in v0.22.0
func (*FileStore) DestroyFingerprints ¶ added in v0.24.0
func (*FileStore) FindAllByPath ¶ added in v0.19.0
FindAllByPath returns all the files that match the given path. Wildcard characters are supported.
func (*FileStore) FindAllInPaths ¶ added in v0.17.0
func (qb *FileStore) FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]models.File, error)
FindAllByPaths returns the all files that are within any of the given paths. Returns all if limit is < 0. Returns all files if p is empty.
func (*FileStore) FindByFileInfo ¶ added in v0.22.0
func (qb *FileStore) FindByFileInfo(ctx context.Context, info fs.FileInfo, size int64) ([]models.File, error)
FindByFileInfo finds files that match the base name, size, and mod time of the given file.
func (*FileStore) FindByFingerprint ¶ added in v0.17.0
func (*FileStore) FindByPath ¶ added in v0.17.0
FindByPath returns the first file that matches the given path. Wildcard characters are supported.
func (*FileStore) FindByZipFileID ¶ added in v0.17.0
func (*FileStore) GetCaptions ¶ added in v0.17.0
func (*FileStore) ModifyFingerprints ¶ added in v0.24.0
func (qb *FileStore) ModifyFingerprints(ctx context.Context, fileID models.FileID, fingerprints []models.Fingerprint) error
ModifyFingerprints updates existing fingerprints and adds new ones.
func (*FileStore) Query ¶ added in v0.17.0
func (qb *FileStore) Query(ctx context.Context, options models.FileQueryOptions) (*models.FileQueryResult, error)
func (*FileStore) UpdateCaptions ¶ added in v0.17.0
type FolderStore ¶ added in v0.17.0
type FolderStore struct {
// contains filtered or unexported fields
}
func NewFolderStore ¶ added in v0.17.0
func NewFolderStore() *FolderStore
func (*FolderStore) CountAllInPaths ¶ added in v0.17.0
CountAllInPaths returns a count of all folders that are within any of the given paths. Returns count of all folders if p is empty.
func (*FolderStore) FindAllInPaths ¶ added in v0.17.0
func (qb *FolderStore) FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]*models.Folder, error)
FindAllInPaths returns the all folders that are or are within any of the given paths. Returns all if limit is < 0. Returns all folders if p is empty.
func (*FolderStore) FindByParentFolderID ¶ added in v0.17.0
func (*FolderStore) FindByPath ¶ added in v0.17.0
func (*FolderStore) FindByZipFileID ¶ added in v0.17.0
type GalleryChapterStore ¶ added in v0.22.0
type GalleryChapterStore struct {
// contains filtered or unexported fields
}
func NewGalleryChapterStore ¶ added in v0.22.0
func NewGalleryChapterStore() *GalleryChapterStore
func (*GalleryChapterStore) Create ¶ added in v0.22.0
func (qb *GalleryChapterStore) Create(ctx context.Context, newObject *models.GalleryChapter) error
func (*GalleryChapterStore) Destroy ¶ added in v0.22.0
func (qb *GalleryChapterStore) Destroy(ctx context.Context, id int) error
func (*GalleryChapterStore) Find ¶ added in v0.22.0
func (qb *GalleryChapterStore) Find(ctx context.Context, id int) (*models.GalleryChapter, error)
returns nil, nil if not found
func (*GalleryChapterStore) FindByGalleryID ¶ added in v0.22.0
func (qb *GalleryChapterStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.GalleryChapter, error)
func (*GalleryChapterStore) FindMany ¶ added in v0.22.0
func (qb *GalleryChapterStore) FindMany(ctx context.Context, ids []int) ([]*models.GalleryChapter, error)
func (*GalleryChapterStore) Update ¶ added in v0.22.0
func (qb *GalleryChapterStore) Update(ctx context.Context, updatedObject *models.GalleryChapter) error
func (*GalleryChapterStore) UpdatePartial ¶ added in v0.22.0
func (qb *GalleryChapterStore) UpdatePartial(ctx context.Context, id int, partial models.GalleryChapterPartial) (*models.GalleryChapter, error)
type GalleryStore ¶ added in v0.17.0
type GalleryStore struct {
// contains filtered or unexported fields
}
func NewGalleryStore ¶ added in v0.17.0
func NewGalleryStore(fileStore *FileStore, folderStore *FolderStore) *GalleryStore
func (*GalleryStore) Count ¶ added in v0.17.0
func (qb *GalleryStore) Count(ctx context.Context) (int, error)
func (*GalleryStore) CountByFileID ¶ added in v0.17.0
func (*GalleryStore) CountByImageID ¶ added in v0.17.0
func (*GalleryStore) Destroy ¶ added in v0.17.0
func (qb *GalleryStore) Destroy(ctx context.Context, id int) error
func (*GalleryStore) FindByChecksum ¶ added in v0.17.0
func (*GalleryStore) FindByChecksums ¶ added in v0.17.0
func (*GalleryStore) FindByFileID ¶ added in v0.17.0
func (*GalleryStore) FindByFingerprints ¶ added in v0.17.0
func (qb *GalleryStore) FindByFingerprints(ctx context.Context, fp []models.Fingerprint) ([]*models.Gallery, error)
func (*GalleryStore) FindByFolderID ¶ added in v0.17.0
func (*GalleryStore) FindByImageID ¶ added in v0.17.0
func (*GalleryStore) FindByPath ¶ added in v0.17.0
func (*GalleryStore) FindBySceneID ¶ added in v0.17.0
func (*GalleryStore) FindUserGalleryByTitle ¶ added in v0.17.0
func (*GalleryStore) GetImageIDs ¶ added in v0.17.0
func (*GalleryStore) GetManyFileIDs ¶ added in v0.17.0
func (*GalleryStore) GetPerformerIDs ¶ added in v0.17.0
func (*GalleryStore) GetSceneIDs ¶ added in v0.17.0
func (*GalleryStore) Query ¶ added in v0.17.0
func (qb *GalleryStore) Query(ctx context.Context, galleryFilter *models.GalleryFilterType, findFilter *models.FindFilterType) ([]*models.Gallery, int, error)
func (*GalleryStore) QueryCount ¶ added in v0.17.0
func (qb *GalleryStore) QueryCount(ctx context.Context, galleryFilter *models.GalleryFilterType, findFilter *models.FindFilterType) (int, error)
func (*GalleryStore) RemoveImages ¶ added in v0.17.0
func (*GalleryStore) ResetCover ¶ added in v0.27.0
func (qb *GalleryStore) ResetCover(ctx context.Context, galleryID int) error
func (*GalleryStore) UpdateImages ¶ added in v0.17.0
func (*GalleryStore) UpdatePartial ¶ added in v0.17.0
func (qb *GalleryStore) UpdatePartial(ctx context.Context, id int, partial models.GalleryPartial) (*models.Gallery, error)
type GroupStore ¶ added in v0.27.0
type GroupStore struct {
// contains filtered or unexported fields
}
func NewGroupStore ¶ added in v0.27.0
func NewGroupStore(blobStore *BlobStore) *GroupStore
func (*GroupStore) AddSubGroups ¶ added in v0.27.0
func (*GroupStore) Count ¶ added in v0.27.0
func (qb *GroupStore) Count(ctx context.Context) (int, error)
func (*GroupStore) CountByPerformerID ¶ added in v0.27.0
func (*GroupStore) CountByStudioID ¶ added in v0.27.0
func (*GroupStore) CountByTagID ¶ added in v0.27.0
func (*GroupStore) Destroy ¶ added in v0.27.0
func (qb *GroupStore) Destroy(ctx context.Context, id int) error
func (*GroupStore) DestroyImage ¶ added in v0.27.0
func (*GroupStore) FindByName ¶ added in v0.27.0
func (*GroupStore) FindByNames ¶ added in v0.27.0
func (*GroupStore) FindByPerformerID ¶ added in v0.27.0
func (*GroupStore) FindByStudioID ¶ added in v0.27.0
func (*GroupStore) FindInAncestors ¶ added in v0.27.0
func (qb *GroupStore) FindInAncestors(ctx context.Context, ascestorIDs []int, ids []int) ([]int, error)
FindInAscestors returns a list of group IDs where a group in the ids list is an ascestor of the ancestor group IDs
func (*GroupStore) FindSubGroupIDs ¶ added in v0.27.0
func (qb *GroupStore) FindSubGroupIDs(ctx context.Context, containingID int, ids []int) ([]int, error)
FindSubGroupIDs returns a list of group IDs where a group in the ids list is a sub-group of the parent group
func (*GroupStore) GetBackImage ¶ added in v0.27.0
func (*GroupStore) GetContainingGroupDescriptions ¶ added in v0.27.0
func (*GroupStore) GetFrontImage ¶ added in v0.27.0
func (*GroupStore) GetSubGroupDescriptions ¶ added in v0.27.0
func (*GroupStore) HasBackImage ¶ added in v0.27.0
func (*GroupStore) HasFrontImage ¶ added in v0.27.0
func (*GroupStore) Query ¶ added in v0.27.0
func (qb *GroupStore) Query(ctx context.Context, groupFilter *models.GroupFilterType, findFilter *models.FindFilterType) ([]*models.Group, int, error)
func (*GroupStore) QueryCount ¶ added in v0.27.0
func (qb *GroupStore) QueryCount(ctx context.Context, groupFilter *models.GroupFilterType, findFilter *models.FindFilterType) (int, error)
func (*GroupStore) RemoveSubGroups ¶ added in v0.27.0
func (*GroupStore) ReorderSubGroups ¶ added in v0.27.0
func (*GroupStore) UpdateBackImage ¶ added in v0.27.0
func (*GroupStore) UpdateFrontImage ¶ added in v0.27.0
func (*GroupStore) UpdateImage ¶ added in v0.27.0
func (*GroupStore) UpdatePartial ¶ added in v0.27.0
func (qb *GroupStore) UpdatePartial(ctx context.Context, id int, partial models.GroupPartial) (*models.Group, error)
type ImageStore ¶ added in v0.17.0
type ImageStore struct {
// contains filtered or unexported fields
}
func NewImageStore ¶ added in v0.17.0
func NewImageStore(r *storeRepository) *ImageStore
func (*ImageStore) Count ¶ added in v0.17.0
func (qb *ImageStore) Count(ctx context.Context) (int, error)
func (*ImageStore) CountByFileID ¶ added in v0.17.0
func (*ImageStore) CountByGalleryID ¶ added in v0.17.0
func (*ImageStore) CoverByGalleryID ¶ added in v0.27.0
Returns the custom cover for the gallery, if one has been set.
func (*ImageStore) DecrementOCounter ¶ added in v0.17.0
func (*ImageStore) Destroy ¶ added in v0.17.0
func (qb *ImageStore) Destroy(ctx context.Context, id int) error
func (*ImageStore) FindByChecksum ¶ added in v0.17.0
func (*ImageStore) FindByFileID ¶ added in v0.17.0
func (*ImageStore) FindByFingerprints ¶ added in v0.17.0
func (qb *ImageStore) FindByFingerprints(ctx context.Context, fp []models.Fingerprint) ([]*models.Image, error)
func (*ImageStore) FindByFolderID ¶ added in v0.17.0
func (*ImageStore) FindByGalleryID ¶ added in v0.17.0
func (*ImageStore) FindByGalleryIDIndex ¶ added in v0.27.0
func (*ImageStore) FindByZipFileID ¶ added in v0.17.0
func (*ImageStore) GetGalleryIDs ¶ added in v0.17.0
func (*ImageStore) GetManyFileIDs ¶ added in v0.17.0
func (*ImageStore) GetPerformerIDs ¶ added in v0.17.0
func (*ImageStore) IncrementOCounter ¶ added in v0.17.0
func (*ImageStore) OCount ¶ added in v0.24.0
func (qb *ImageStore) OCount(ctx context.Context) (int, error)
func (*ImageStore) OCountByPerformerID ¶ added in v0.21.0
func (*ImageStore) Query ¶ added in v0.17.0
func (qb *ImageStore) Query(ctx context.Context, options models.ImageQueryOptions) (*models.ImageQueryResult, error)
func (*ImageStore) QueryCount ¶ added in v0.17.0
func (qb *ImageStore) QueryCount(ctx context.Context, imageFilter *models.ImageFilterType, findFilter *models.FindFilterType) (int, error)
func (*ImageStore) RemoveFileID ¶ added in v0.27.0
RemoveFileID removes the file ID from the image. If the file ID is the primary file, then the next file in the list is set as the primary file.
func (*ImageStore) ResetOCounter ¶ added in v0.17.0
func (*ImageStore) Size ¶ added in v0.17.0
func (qb *ImageStore) Size(ctx context.Context) (float64, error)
func (*ImageStore) UpdatePartial ¶ added in v0.17.0
func (qb *ImageStore) UpdatePartial(ctx context.Context, id int, partial models.ImagePartial) (*models.Image, error)
func (*ImageStore) UpdatePerformers ¶ added in v0.17.0
func (*ImageStore) UpdateTags ¶ added in v0.17.0
type MigrationNeededError ¶ added in v0.17.0
ErrMigrationNeeded indicates that a database migration is needed before the database can be initialized
func (*MigrationNeededError) Error ¶ added in v0.17.0
func (e *MigrationNeededError) Error() string
type Migrator ¶ added in v0.26.0
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶ added in v0.26.0
func (*Migrator) CurrentSchemaVersion ¶ added in v0.26.0
func (*Migrator) RequiredSchemaVersion ¶ added in v0.26.0
type MismatchedSchemaVersionError ¶ added in v0.17.0
func (*MismatchedSchemaVersionError) Error ¶ added in v0.17.0
func (e *MismatchedSchemaVersionError) Error() string
type NotFoundError ¶ added in v0.17.0
func (*NotFoundError) Error ¶ added in v0.17.0
func (e *NotFoundError) Error() string
type NullDate ¶ added in v0.22.0
NullDate represents a nullable date stored as "YYYY-MM-DD"
func NullDateFromDatePtr ¶ added in v0.22.0
type NullTimestamp ¶ added in v0.22.0
NullTimestamp represents a nullable time stored in RFC3339 format.
func NullTimestampFromTimePtr ¶ added in v0.22.0
func NullTimestampFromTimePtr(t *time.Time) NullTimestamp
func (*NullTimestamp) Scan ¶ added in v0.22.0
func (t *NullTimestamp) Scan(value interface{}) error
Scan implements the Scanner interface.
func (NullTimestamp) TimePtr ¶ added in v0.22.0
func (t NullTimestamp) TimePtr() *time.Time
type PerformerStore ¶ added in v0.18.0
type PerformerStore struct {
// contains filtered or unexported fields
}
func NewPerformerStore ¶ added in v0.18.0
func NewPerformerStore(blobStore *BlobStore) *PerformerStore
func (*PerformerStore) Count ¶ added in v0.18.0
func (qb *PerformerStore) Count(ctx context.Context) (int, error)
func (*PerformerStore) CountByTagID ¶ added in v0.18.0
func (*PerformerStore) Destroy ¶ added in v0.18.0
func (qb *PerformerStore) Destroy(ctx context.Context, id int) error
func (*PerformerStore) DestroyImage ¶ added in v0.18.0
func (*PerformerStore) FindByGalleryID ¶ added in v0.18.0
func (*PerformerStore) FindByImageID ¶ added in v0.18.0
func (*PerformerStore) FindByNames ¶ added in v0.18.0
func (*PerformerStore) FindBySceneID ¶ added in v0.18.0
func (*PerformerStore) FindByStashID ¶ added in v0.18.0
func (*PerformerStore) FindByStashIDStatus ¶ added in v0.18.0
func (*PerformerStore) GetAliases ¶ added in v0.19.0
func (*PerformerStore) GetStashIDs ¶ added in v0.18.0
func (*PerformerStore) Query ¶ added in v0.18.0
func (qb *PerformerStore) Query(ctx context.Context, performerFilter *models.PerformerFilterType, findFilter *models.FindFilterType) ([]*models.Performer, int, error)
func (*PerformerStore) QueryCount ¶ added in v0.19.0
func (qb *PerformerStore) QueryCount(ctx context.Context, performerFilter *models.PerformerFilterType, findFilter *models.FindFilterType) (int, error)
func (*PerformerStore) QueryForAutoTag ¶ added in v0.18.0
func (*PerformerStore) UpdateImage ¶ added in v0.18.0
func (*PerformerStore) UpdatePartial ¶ added in v0.18.0
func (qb *PerformerStore) UpdatePartial(ctx context.Context, id int, partial models.PerformerPartial) (*models.Performer, error)
type SavedFilterStore ¶ added in v0.22.0
type SavedFilterStore struct {
// contains filtered or unexported fields
}
func NewSavedFilterStore ¶ added in v0.22.0
func NewSavedFilterStore() *SavedFilterStore
func (*SavedFilterStore) All ¶ added in v0.22.0
func (qb *SavedFilterStore) All(ctx context.Context) ([]*models.SavedFilter, error)
func (*SavedFilterStore) Create ¶ added in v0.22.0
func (qb *SavedFilterStore) Create(ctx context.Context, newObject *models.SavedFilter) error
func (*SavedFilterStore) Destroy ¶ added in v0.22.0
func (qb *SavedFilterStore) Destroy(ctx context.Context, id int) error
func (*SavedFilterStore) Find ¶ added in v0.22.0
func (qb *SavedFilterStore) Find(ctx context.Context, id int) (*models.SavedFilter, error)
returns nil, nil if not found
func (*SavedFilterStore) FindByMode ¶ added in v0.22.0
func (qb *SavedFilterStore) FindByMode(ctx context.Context, mode models.FilterMode) ([]*models.SavedFilter, error)
func (*SavedFilterStore) FindMany ¶ added in v0.22.0
func (qb *SavedFilterStore) FindMany(ctx context.Context, ids []int, ignoreNotFound bool) ([]*models.SavedFilter, error)
func (*SavedFilterStore) Update ¶ added in v0.22.0
func (qb *SavedFilterStore) Update(ctx context.Context, updatedObject *models.SavedFilter) error
type SceneMarkerStore ¶ added in v0.22.0
type SceneMarkerStore struct{}
func NewSceneMarkerStore ¶ added in v0.22.0
func NewSceneMarkerStore() *SceneMarkerStore
func (*SceneMarkerStore) All ¶ added in v0.22.0
func (qb *SceneMarkerStore) All(ctx context.Context) ([]*models.SceneMarker, error)
func (*SceneMarkerStore) Count ¶ added in v0.22.0
func (qb *SceneMarkerStore) Count(ctx context.Context) (int, error)
func (*SceneMarkerStore) CountByTagID ¶ added in v0.22.0
func (*SceneMarkerStore) Create ¶ added in v0.22.0
func (qb *SceneMarkerStore) Create(ctx context.Context, newObject *models.SceneMarker) error
func (*SceneMarkerStore) Destroy ¶ added in v0.22.0
func (qb *SceneMarkerStore) Destroy(ctx context.Context, id int) error
func (*SceneMarkerStore) Find ¶ added in v0.22.0
func (qb *SceneMarkerStore) Find(ctx context.Context, id int) (*models.SceneMarker, error)
returns nil, nil if not found
func (*SceneMarkerStore) FindBySceneID ¶ added in v0.22.0
func (qb *SceneMarkerStore) FindBySceneID(ctx context.Context, sceneID int) ([]*models.SceneMarker, error)
func (*SceneMarkerStore) FindMany ¶ added in v0.22.0
func (qb *SceneMarkerStore) FindMany(ctx context.Context, ids []int) ([]*models.SceneMarker, error)
func (*SceneMarkerStore) GetMarkerStrings ¶ added in v0.22.0
func (qb *SceneMarkerStore) GetMarkerStrings(ctx context.Context, q *string, sort *string) ([]*models.MarkerStringsResultType, error)
func (*SceneMarkerStore) Query ¶ added in v0.22.0
func (qb *SceneMarkerStore) Query(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, findFilter *models.FindFilterType) ([]*models.SceneMarker, int, error)
func (*SceneMarkerStore) QueryCount ¶ added in v0.22.0
func (qb *SceneMarkerStore) QueryCount(ctx context.Context, sceneMarkerFilter *models.SceneMarkerFilterType, findFilter *models.FindFilterType) (int, error)
func (*SceneMarkerStore) Update ¶ added in v0.22.0
func (qb *SceneMarkerStore) Update(ctx context.Context, updatedObject *models.SceneMarker) error
func (*SceneMarkerStore) UpdatePartial ¶ added in v0.22.0
func (qb *SceneMarkerStore) UpdatePartial(ctx context.Context, id int, partial models.SceneMarkerPartial) (*models.SceneMarker, error)
func (*SceneMarkerStore) UpdateTags ¶ added in v0.22.0
func (*SceneMarkerStore) Wall ¶ added in v0.22.0
func (qb *SceneMarkerStore) Wall(ctx context.Context, q *string) ([]*models.SceneMarker, error)
type SceneStore ¶ added in v0.17.0
type SceneStore struct {
// contains filtered or unexported fields
}
func NewSceneStore ¶ added in v0.17.0
func NewSceneStore(r *storeRepository, blobStore *BlobStore) *SceneStore
func (*SceneStore) AddGalleryIDs ¶ added in v0.17.0
func (*SceneStore) AssignFiles ¶ added in v0.18.0
func (*SceneStore) Count ¶ added in v0.17.0
func (qb *SceneStore) Count(ctx context.Context) (int, error)
func (*SceneStore) CountAllViews ¶ added in v0.25.0
func (*SceneStore) CountByFileID ¶ added in v0.17.0
func (*SceneStore) CountByPerformerID ¶ added in v0.17.0
func (*SceneStore) CountByStudioID ¶ added in v0.17.0
TODO - currently only used by unit test
func (*SceneStore) CountMissingChecksum ¶ added in v0.17.0
func (qb *SceneStore) CountMissingChecksum(ctx context.Context) (int, error)
CountMissingChecksum returns the number of scenes missing a checksum value.
func (*SceneStore) CountMissingOSHash ¶ added in v0.17.0
func (qb *SceneStore) CountMissingOSHash(ctx context.Context) (int, error)
CountMissingOSHash returns the number of scenes missing an oshash value.
func (*SceneStore) CountUniqueViews ¶ added in v0.25.0
func (*SceneStore) CountViews ¶ added in v0.25.0
func (*SceneStore) DeleteAllViews ¶ added in v0.25.0
func (*SceneStore) DeleteViews ¶ added in v0.25.0
func (*SceneStore) Destroy ¶ added in v0.17.0
func (qb *SceneStore) Destroy(ctx context.Context, id int) error
func (*SceneStore) DestroyImage ¶ added in v0.20.0
func (*SceneStore) Duration ¶ added in v0.17.0
func (qb *SceneStore) Duration(ctx context.Context) (float64, error)
func (*SceneStore) FindByChecksum ¶ added in v0.17.0
func (*SceneStore) FindByFileID ¶ added in v0.17.0
func (*SceneStore) FindByFingerprints ¶ added in v0.17.0
func (qb *SceneStore) FindByFingerprints(ctx context.Context, fp []models.Fingerprint) ([]*models.Scene, error)
func (*SceneStore) FindByGalleryID ¶ added in v0.17.0
func (*SceneStore) FindByGroupID ¶ added in v0.27.0
func (*SceneStore) FindByOSHash ¶ added in v0.17.0
func (*SceneStore) FindByPath ¶ added in v0.17.0
func (*SceneStore) FindByPerformerID ¶ added in v0.17.0
func (*SceneStore) FindByPrimaryFileID ¶ added in v0.17.0
func (*SceneStore) FindDuplicates ¶ added in v0.17.0
func (*SceneStore) GetAllOCount ¶ added in v0.25.0
func (*SceneStore) GetGalleryIDs ¶ added in v0.17.0
func (*SceneStore) GetGroups ¶ added in v0.27.0
func (qb *SceneStore) GetGroups(ctx context.Context, id int) (ret []models.GroupsScenes, err error)
func (*SceneStore) GetManyFileIDs ¶ added in v0.17.0
func (*SceneStore) GetManyLastViewed ¶ added in v0.25.0
func (*SceneStore) GetManyOCount ¶ added in v0.25.0
func (*SceneStore) GetManyODates ¶ added in v0.25.0
func (*SceneStore) GetManyViewCount ¶ added in v0.25.0
func (*SceneStore) GetManyViewDates ¶ added in v0.25.0
func (*SceneStore) GetPerformerIDs ¶ added in v0.17.0
func (*SceneStore) GetStashIDs ¶ added in v0.17.0
func (*SceneStore) GetUniqueOCount ¶ added in v0.25.0
func (*SceneStore) GetViewDates ¶ added in v0.25.0
func (*SceneStore) OCountByPerformerID ¶ added in v0.21.0
func (*SceneStore) PlayDuration ¶ added in v0.22.0
func (qb *SceneStore) PlayDuration(ctx context.Context) (float64, error)
func (*SceneStore) Query ¶ added in v0.17.0
func (qb *SceneStore) Query(ctx context.Context, options models.SceneQueryOptions) (*models.SceneQueryResult, error)
func (*SceneStore) QueryCount ¶ added in v0.22.0
func (qb *SceneStore) QueryCount(ctx context.Context, sceneFilter *models.SceneFilterType, findFilter *models.FindFilterType) (int, error)
func (*SceneStore) ResetActivity ¶ added in v0.27.0
func (*SceneStore) SaveActivity ¶ added in v0.18.0
func (*SceneStore) Size ¶ added in v0.17.0
func (qb *SceneStore) Size(ctx context.Context) (float64, error)
func (*SceneStore) UpdateCover ¶ added in v0.17.0
func (*SceneStore) UpdateImage ¶ added in v0.20.0
func (*SceneStore) UpdatePartial ¶ added in v0.17.0
func (qb *SceneStore) UpdatePartial(ctx context.Context, id int, partial models.ScenePartial) (*models.Scene, error)
type StudioStore ¶ added in v0.22.0
type StudioStore struct {
// contains filtered or unexported fields
}
func NewStudioStore ¶ added in v0.22.0
func NewStudioStore(blobStore *BlobStore) *StudioStore
func (*StudioStore) Count ¶ added in v0.22.0
func (qb *StudioStore) Count(ctx context.Context) (int, error)
func (*StudioStore) CountByTagID ¶ added in v0.27.0
func (*StudioStore) Destroy ¶ added in v0.22.0
func (qb *StudioStore) Destroy(ctx context.Context, id int) error
func (*StudioStore) DestroyImage ¶ added in v0.22.0
func (*StudioStore) FindByName ¶ added in v0.22.0
func (*StudioStore) FindBySceneID ¶ added in v0.22.0
func (*StudioStore) FindByStashID ¶ added in v0.22.0
func (*StudioStore) FindByStashIDStatus ¶ added in v0.22.0
func (*StudioStore) FindChildren ¶ added in v0.22.0
func (*StudioStore) GetAliases ¶ added in v0.22.0
func (*StudioStore) GetStashIDs ¶ added in v0.22.0
func (*StudioStore) Query ¶ added in v0.22.0
func (qb *StudioStore) Query(ctx context.Context, studioFilter *models.StudioFilterType, findFilter *models.FindFilterType) ([]*models.Studio, int, error)
func (*StudioStore) QueryCount ¶ added in v0.27.0
func (qb *StudioStore) QueryCount(ctx context.Context, studioFilter *models.StudioFilterType, findFilter *models.FindFilterType) (int, error)
func (*StudioStore) QueryForAutoTag ¶ added in v0.22.0
func (*StudioStore) UpdateImage ¶ added in v0.22.0
func (*StudioStore) UpdatePartial ¶ added in v0.22.0
func (qb *StudioStore) UpdatePartial(ctx context.Context, input models.StudioPartial) (*models.Studio, error)
type TagStore ¶ added in v0.22.0
type TagStore struct {
// contains filtered or unexported fields
}
func NewTagStore ¶ added in v0.22.0
func (*TagStore) CountByChildTagID ¶ added in v0.23.0
func (*TagStore) CountByParentTagID ¶ added in v0.23.0
func (*TagStore) DestroyImage ¶ added in v0.22.0
func (*TagStore) FindAllAncestors ¶ added in v0.22.0
func (qb *TagStore) FindAllAncestors(ctx context.Context, tagID int, excludeIDs []int) ([]*models.TagPath, error)
FindAllAncestors returns a slice of TagPath objects, representing all ancestors of the tag with the provided id.
func (*TagStore) FindAllDescendants ¶ added in v0.22.0
func (qb *TagStore) FindAllDescendants(ctx context.Context, tagID int, excludeIDs []int) ([]*models.TagPath, error)
FindAllDescendants returns a slice of TagPath objects, representing all descendants of the tag with the provided id.
func (*TagStore) FindByChildTagID ¶ added in v0.22.0
func (*TagStore) FindByGalleryID ¶ added in v0.22.0
func (*TagStore) FindByGroupID ¶ added in v0.27.0
func (*TagStore) FindByImageID ¶ added in v0.22.0
func (*TagStore) FindByName ¶ added in v0.22.0
func (*TagStore) FindByNames ¶ added in v0.22.0
func (*TagStore) FindByParentTagID ¶ added in v0.22.0
func (*TagStore) FindByPerformerID ¶ added in v0.22.0
func (*TagStore) FindBySceneID ¶ added in v0.22.0
func (*TagStore) FindBySceneMarkerID ¶ added in v0.22.0
func (*TagStore) FindByStudioID ¶ added in v0.27.0
func (*TagStore) GetAliases ¶ added in v0.22.0
func (*TagStore) GetChildIDs ¶ added in v0.27.0
func (*TagStore) GetParentIDs ¶ added in v0.27.0
func (*TagStore) QueryForAutoTag ¶ added in v0.22.0
func (*TagStore) UpdateAliases ¶ added in v0.22.0
func (*TagStore) UpdateChildTags ¶ added in v0.22.0
func (*TagStore) UpdateImage ¶ added in v0.22.0
func (*TagStore) UpdateParentTags ¶ added in v0.22.0
type Timestamp ¶ added in v0.22.0
Timestamp represents a time stored in RFC3339 format.
type UTCTimestamp ¶ added in v0.25.0
type UTCTimestamp struct {
Timestamp
}
UTCTimestamp stores a time in UTC. TODO - Timestamp should use UTC by default
Source Files ¶
- anonymise.go
- batch.go
- blob.go
- blob_migrate.go
- common.go
- criterion_handlers.go
- custom_migrations.go
- database.go
- date.go
- doc.go
- driver.go
- file.go
- filter.go
- filter_hierarchical.go
- fingerprint.go
- folder.go
- functions.go
- gallery.go
- gallery_chapter.go
- gallery_filter.go
- group.go
- group_filter.go
- group_relationships.go
- history.go
- image.go
- image_filter.go
- migrate.go
- performer.go
- performer_filter.go
- phash.go
- query.go
- record.go
- regex.go
- relationships.go
- repository.go
- saved_filter.go
- scene.go
- scene_filter.go
- scene_marker.go
- scene_marker_filter.go
- sql.go
- studio.go
- studio_filter.go
- table.go
- tables.go
- tag.go
- tag_filter.go
- timestamp.go
- transaction.go
- tx.go
- values.go