Documentation ¶
Index ¶
- Variables
- func NewMovieReaderWriter(blobStore *BlobStore) *movieQueryBuilder
- func NewStudioReaderWriter(blobStore *BlobStore) *studioQueryBuilder
- func NewTagReaderWriter(blobStore *BlobStore) *tagQueryBuilder
- 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) 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) Anonymise(outPath string) error
- func (db *Database) AnonymousDatabasePath(backupDirectoryPath string) string
- func (db *Database) AppSchemaVersion() uint
- func (db *Database) Backup(backupPath string) error
- func (db *Database) Begin(ctx context.Context, exclusive 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) IsLocked(err error) bool
- func (db *Database) Open(dbPath string) error
- func (db *Database) Ready() error
- func (db *Database) Remove() error
- func (db *Database) Reset() error
- func (db *Database) RestoreFromBackup(backupPath string) error
- func (db *Database) Rollback(ctx context.Context) error
- func (db *Database) RunMigrations() error
- func (db *Database) SetBlobStoreOptions(options BlobStoreOptions)
- func (db *Database) TxnRepository() models.Repository
- func (db *Database) Vacuum(ctx context.Context) error
- func (db *Database) Version() uint
- func (db *Database) WithDatabase(ctx context.Context) (context.Context, error)
- type FileStore
- func (qb *FileStore) CountAllInPaths(ctx context.Context, p []string) (int, error)
- func (qb *FileStore) Create(ctx context.Context, f file.File) error
- func (qb *FileStore) Destroy(ctx context.Context, id file.ID) error
- func (qb *FileStore) Find(ctx context.Context, ids ...file.ID) ([]file.File, error)
- func (qb *FileStore) FindAllByPath(ctx context.Context, p string) ([]file.File, error)
- func (qb *FileStore) FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]file.File, error)
- func (qb *FileStore) FindByFingerprint(ctx context.Context, fp file.Fingerprint) ([]file.File, error)
- func (qb *FileStore) FindByPath(ctx context.Context, p string) (file.File, error)
- func (qb *FileStore) FindByZipFileID(ctx context.Context, zipFileID file.ID) ([]file.File, error)
- func (qb *FileStore) GetCaptions(ctx context.Context, fileID file.ID) ([]*models.VideoCaption, error)
- func (qb *FileStore) IsPrimary(ctx context.Context, fileID file.ID) (bool, error)
- func (qb *FileStore) Query(ctx context.Context, options models.FileQueryOptions) (*models.FileQueryResult, error)
- func (qb *FileStore) Update(ctx context.Context, f file.File) error
- func (qb *FileStore) UpdateCaptions(ctx context.Context, fileID file.ID, 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 *file.Folder) error
- func (qb *FolderStore) Destroy(ctx context.Context, id file.FolderID) error
- func (qb *FolderStore) Find(ctx context.Context, id file.FolderID) (*file.Folder, error)
- func (qb *FolderStore) FindAllInPaths(ctx context.Context, p []string, limit, offset int) ([]*file.Folder, error)
- func (qb *FolderStore) FindByParentFolderID(ctx context.Context, parentFolderID file.FolderID) ([]*file.Folder, error)
- func (qb *FolderStore) FindByPath(ctx context.Context, p string) (*file.Folder, error)
- func (qb *FolderStore) FindByZipFileID(ctx context.Context, zipFileID file.ID) ([]*file.Folder, error)
- func (qb *FolderStore) Update(ctx context.Context, updatedObject *file.Folder) error
- type GalleryStore
- func (qb *GalleryStore) AddFileID(ctx context.Context, id int, fileID file.ID) 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 file.ID) (int, error)
- func (qb *GalleryStore) CountByImageID(ctx context.Context, imageID int) (int, error)
- func (qb *GalleryStore) Create(ctx context.Context, newObject *models.Gallery, fileIDs []file.ID) 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 file.ID) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByFingerprints(ctx context.Context, fp []file.Fingerprint) ([]*models.Gallery, error)
- func (qb *GalleryStore) FindByFolderID(ctx context.Context, folderID file.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) ([]file.File, error)
- func (qb *GalleryStore) GetImageIDs(ctx context.Context, galleryID int) ([]int, error)
- func (qb *GalleryStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]file.ID, 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) 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) 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 ImageStore
- func (qb *ImageStore) AddFileID(ctx context.Context, id int, fileID file.ID) 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 file.ID) (int, error)
- func (qb *ImageStore) CountByGalleryID(ctx context.Context, galleryID int) (int, error)
- func (qb *ImageStore) Create(ctx context.Context, newObject *models.ImageCreateInput) 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 file.ID) ([]*models.Image, error)
- func (qb *ImageStore) FindByFingerprints(ctx context.Context, fp []file.Fingerprint) ([]*models.Image, error)
- func (qb *ImageStore) FindByFolderID(ctx context.Context, folderID file.FolderID) ([]*models.Image, error)
- func (qb *ImageStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.Image, error)
- func (qb *ImageStore) FindByZipFileID(ctx context.Context, zipFileID file.ID) ([]*models.Image, error)
- func (qb *ImageStore) FindMany(ctx context.Context, ids []int) ([]*models.Image, error)
- func (qb *ImageStore) GetFiles(ctx context.Context, id int) ([]*file.ImageFile, error)
- func (qb *ImageStore) GetGalleryIDs(ctx context.Context, imageID int) ([]int, error)
- func (qb *ImageStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]file.ID, 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) IncrementOCounter(ctx context.Context, id 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) 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 MismatchedSchemaVersionError
- type NotFoundError
- 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, performerID int) 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) HasImage(ctx context.Context, id int, blobCol string) (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 SceneStore
- func (qb *SceneStore) AddFileID(ctx context.Context, id int, fileID file.ID) error
- func (qb *SceneStore) AddGalleryIDs(ctx context.Context, sceneID int, galleryIDs []int) error
- func (qb *SceneStore) All(ctx context.Context) ([]*models.Scene, error)
- func (qb *SceneStore) AssignFiles(ctx context.Context, sceneID int, fileIDs []file.ID) error
- func (qb *SceneStore) Count(ctx context.Context) (int, error)
- func (qb *SceneStore) CountByFileID(ctx context.Context, fileID file.ID) (int, error)
- func (qb *SceneStore) CountByMovieID(ctx context.Context, movieID int) (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) CountByTagID(ctx context.Context, tagID int) (int, error)
- func (qb *SceneStore) CountMissingChecksum(ctx context.Context) (int, error)
- func (qb *SceneStore) CountMissingOSHash(ctx context.Context) (int, error)
- func (qb *SceneStore) Create(ctx context.Context, newObject *models.Scene, fileIDs []file.ID) error
- func (qb *SceneStore) DecrementOCounter(ctx context.Context, id int) (int, 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 file.ID) ([]*models.Scene, error)
- func (qb *SceneStore) FindByFingerprints(ctx context.Context, fp []file.Fingerprint) ([]*models.Scene, error)
- func (qb *SceneStore) FindByGalleryID(ctx context.Context, galleryID int) ([]*models.Scene, error)
- func (qb *SceneStore) FindByMovieID(ctx context.Context, movieID 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 file.ID) ([]*models.Scene, error)
- func (qb *SceneStore) FindDuplicates(ctx context.Context, distance int) ([][]*models.Scene, error)
- func (qb *SceneStore) FindMany(ctx context.Context, ids []int) ([]*models.Scene, error)
- func (qb *SceneStore) GetCover(ctx context.Context, sceneID int) ([]byte, error)
- func (qb *SceneStore) GetFiles(ctx context.Context, id int) ([]*file.VideoFile, error)
- func (qb *SceneStore) GetGalleryIDs(ctx context.Context, id int) ([]int, error)
- func (qb *SceneStore) GetImage(ctx context.Context, id int, blobCol string) ([]byte, error)
- func (qb *SceneStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]file.ID, error)
- func (qb *SceneStore) GetMovies(ctx context.Context, id int) (ret []models.MoviesScenes, err 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) HasCover(ctx context.Context, sceneID int) (bool, error)
- func (qb *SceneStore) HasImage(ctx context.Context, id int, blobCol string) (bool, error)
- func (qb *SceneStore) IncrementOCounter(ctx context.Context, id int) (int, error)
- func (qb *SceneStore) IncrementWatchCount(ctx context.Context, id int) (int, error)
- func (qb *SceneStore) Query(ctx context.Context, options models.SceneQueryOptions) (*models.SceneQueryResult, error)
- func (qb *SceneStore) ResetOCounter(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)
Constants ¶
This section is empty.
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,
}
var GalleryChapterReaderWriter = &galleryChapterQueryBuilder{
repository{
tableName: galleriesChaptersTable,
idColumn: idColumn,
},
}
var SavedFilterReaderWriter = &savedFilterQueryBuilder{
repository{
tableName: savedFilterTable,
idColumn: idColumn,
},
}
var SceneMarkerReaderWriter = &sceneMarkerQueryBuilder{
repository{
tableName: sceneMarkerTable,
idColumn: idColumn,
},
}
var ScrapedItemReaderWriter = &scrapedItemQueryBuilder{
repository{
tableName: scrapedItemTable,
idColumn: idColumn,
},
}
Functions ¶
func NewMovieReaderWriter ¶
func NewMovieReaderWriter(blobStore *BlobStore) *movieQueryBuilder
func NewStudioReaderWriter ¶
func NewStudioReaderWriter(blobStore *BlobStore) *studioQueryBuilder
func NewTagReaderWriter ¶
func NewTagReaderWriter(blobStore *BlobStore) *tagQueryBuilder
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) 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 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 { Blobs *BlobStore File *FileStore Folder *FolderStore Image *ImageStore Gallery *GalleryStore Scene *SceneStore Performer *PerformerStore Studio *studioQueryBuilder Tag *tagQueryBuilder Movie *movieQueryBuilder // contains filtered or unexported fields }
func NewDatabase ¶ added in v0.17.0
func NewDatabase() *Database
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) Ready ¶ added in v0.17.0
Ready returns an error if the database is not ready to begin transactions.
func (*Database) RestoreFromBackup ¶ added in v0.17.0
func (*Database) RunMigrations ¶ added in v0.17.0
Migrate the database
func (*Database) SetBlobStoreOptions ¶ added in v0.20.0
func (db *Database) SetBlobStoreOptions(options BlobStoreOptions)
func (*Database) TxnRepository ¶ added in v0.17.0
func (db *Database) TxnRepository() models.Repository
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) 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) ([]file.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) 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) 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) ([]*file.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 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 []file.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) 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 ImageStore ¶ added in v0.17.0
type ImageStore struct {
// contains filtered or unexported fields
}
func NewImageStore ¶ added in v0.17.0
func NewImageStore(fileStore *FileStore) *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) Create ¶ added in v0.17.0
func (qb *ImageStore) Create(ctx context.Context, newObject *models.ImageCreateInput) error
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 []file.Fingerprint) ([]*models.Image, error)
func (*ImageStore) FindByFolderID ¶ added in v0.17.0
func (*ImageStore) FindByGalleryID ¶ added in v0.17.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) 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) 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 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 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 (qb *PerformerStore) DestroyImage(ctx context.Context, performerID int) error
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 SceneStore ¶ added in v0.17.0
type SceneStore struct {
// contains filtered or unexported fields
}
func NewSceneStore ¶ added in v0.17.0
func NewSceneStore(fileStore *FileStore, 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) CountByFileID ¶ added in v0.17.0
func (*SceneStore) CountByMovieID ¶ added in v0.17.0
func (*SceneStore) CountByPerformerID ¶ added in v0.17.0
func (*SceneStore) CountByStudioID ¶ added in v0.17.0
func (*SceneStore) CountByTagID ¶ added in v0.17.0
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) DecrementOCounter ¶ added in v0.17.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 []file.Fingerprint) ([]*models.Scene, error)
func (*SceneStore) FindByGalleryID ¶ added in v0.17.0
func (*SceneStore) FindByMovieID ¶ added in v0.17.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) GetGalleryIDs ¶ added in v0.17.0
func (*SceneStore) GetManyFileIDs ¶ added in v0.17.0
func (*SceneStore) GetMovies ¶ added in v0.17.0
func (qb *SceneStore) GetMovies(ctx context.Context, id int) (ret []models.MoviesScenes, err error)
func (*SceneStore) GetPerformerIDs ¶ added in v0.17.0
func (*SceneStore) GetStashIDs ¶ added in v0.17.0
func (*SceneStore) IncrementOCounter ¶ added in v0.17.0
func (*SceneStore) IncrementWatchCount ¶ added in v0.18.0
func (*SceneStore) Query ¶ added in v0.17.0
func (qb *SceneStore) Query(ctx context.Context, options models.SceneQueryOptions) (*models.SceneQueryResult, error)
func (*SceneStore) ResetOCounter ¶ added in v0.17.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)
Source Files ¶
- anonymise.go
- batch.go
- blob.go
- blob_migrate.go
- common.go
- custom_migrations.go
- database.go
- driver.go
- file.go
- filter.go
- fingerprint.go
- folder.go
- functions.go
- gallery.go
- gallery_chapter.go
- image.go
- movies.go
- performer.go
- query.go
- record.go
- regex.go
- repository.go
- saved_filter.go
- scene.go
- scene_marker.go
- scraped_item.go
- sql.go
- studio.go
- table.go
- tables.go
- tag.go
- transaction.go
- tx.go
- values.go