mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Files refactor fixes (#2743)
* Fix destroy gallery not destroying file * Re-add minModTime functionality * Deprecate useFileMetadata and stripFileExtension * Optimise files post migration * Decorate moved files. Use first missing file in move * Include path in thumbnail generation error log * Fix stash-box draft submission * Don't destroy files unless deleting * Call handler for files with no associated objects * Fix moved zips causing error on scan
This commit is contained in:
@@ -379,6 +379,13 @@ func (qb *ImageStore) FindByFileID(ctx context.Context, fileID file.ID) ([]*mode
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (qb *ImageStore) CountByFileID(ctx context.Context, fileID file.ID) (int, error) {
|
||||
joinTable := imagesFilesJoinTable
|
||||
|
||||
q := dialect.Select(goqu.COUNT("*")).From(joinTable).Where(joinTable.Col(fileIDColumn).Eq(fileID))
|
||||
return count(ctx, q)
|
||||
}
|
||||
|
||||
func (qb *ImageStore) FindByFingerprints(ctx context.Context, fp []file.Fingerprint) ([]*models.Image, error) {
|
||||
table := imagesQueryTable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user