mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Blob fixes (#3599)
* Fix error if movie back image blob was not found * Don't error out if scene cover get fails * Don't error out on image get fails * Add debug logging for fs blobs * Remove old blob data when no longer referenced
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
"github.com/stashapp/stash/pkg/models/json"
|
||||
"github.com/stashapp/stash/pkg/models/jsonschema"
|
||||
@@ -64,7 +65,7 @@ func ToJSON(ctx context.Context, reader ImageGetter, studioReader studio.Finder,
|
||||
|
||||
frontImage, err := reader.GetFrontImage(ctx, movie.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting movie front image: %v", err)
|
||||
logger.Errorf("Error getting movie front image: %v", err)
|
||||
}
|
||||
|
||||
if len(frontImage) > 0 {
|
||||
@@ -73,7 +74,7 @@ func ToJSON(ctx context.Context, reader ImageGetter, studioReader studio.Finder,
|
||||
|
||||
backImage, err := reader.GetBackImage(ctx, movie.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting movie back image: %v", err)
|
||||
logger.Errorf("Error getting movie back image: %v", err)
|
||||
}
|
||||
|
||||
if len(backImage) > 0 {
|
||||
|
||||
@@ -161,13 +161,15 @@ func initTestTable() {
|
||||
},
|
||||
{
|
||||
createFullMovie(errFrontImageID, studioID),
|
||||
nil,
|
||||
true,
|
||||
createFullJSONMovie(studioName, "", backImage),
|
||||
// failure to get front image should not cause error
|
||||
false,
|
||||
},
|
||||
{
|
||||
createFullMovie(errBackImageID, studioID),
|
||||
nil,
|
||||
true,
|
||||
createFullJSONMovie(studioName, frontImage, ""),
|
||||
// failure to get back image should not cause error
|
||||
false,
|
||||
},
|
||||
{
|
||||
createFullMovie(errStudioMovieID, errStudioID),
|
||||
|
||||
Reference in New Issue
Block a user