mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add Clean generated files task (#4607)
* Add clean generate task * Add to library tasks * Save and read defaults * Stop handling and logging * Make filename parsing more robust
This commit is contained in:
@@ -235,6 +235,17 @@ func (qb *BlobStore) readFromFilesystem(ctx context.Context, checksum string) ([
|
||||
}
|
||||
}
|
||||
|
||||
func (qb *BlobStore) EntryExists(ctx context.Context, checksum string) (bool, error) {
|
||||
q := dialect.From(qb.table()).Select(goqu.COUNT("*")).Where(qb.tableMgr.byID(checksum))
|
||||
|
||||
var found int
|
||||
if err := querySimple(ctx, q, &found); err != nil {
|
||||
return false, fmt.Errorf("querying %s: %w", qb.table(), err)
|
||||
}
|
||||
|
||||
return found != 0, nil
|
||||
}
|
||||
|
||||
// Read reads the data from the database or filesystem, depending on which is enabled.
|
||||
func (qb *BlobStore) Read(ctx context.Context, checksum string) ([]byte, error) {
|
||||
if !qb.options.UseDatabase && !qb.options.UseFilesystem {
|
||||
|
||||
Reference in New Issue
Block a user