Various bug fixes (#2938)

* Don't recalculate MD5 if not enabled

Remove MD5 if oshash has changed and MD5 was not calculated.

* Fix panic in paged DLNA
* Prevent identical hashes in stash-box drafts
This commit is contained in:
WithoutPants
2022-09-21 15:39:41 +10:00
committed by GitHub
parent cffcd9f4b8
commit b74428cb42
7 changed files with 120 additions and 62 deletions

View File

@@ -6,6 +6,7 @@ import (
"math"
"strconv"
"github.com/stashapp/stash/pkg/file"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/scene"
)
@@ -59,7 +60,7 @@ func (p *scenePager) getPages(ctx context.Context, r scene.Queryer, total int) (
return objs, nil
}
func (p *scenePager) getPageVideos(ctx context.Context, r SceneFinder, page int, host string) ([]interface{}, error) {
func (p *scenePager) getPageVideos(ctx context.Context, r SceneFinder, f file.Finder, page int, host string) ([]interface{}, error) {
var objs []interface{}
sort := "title"
@@ -75,6 +76,10 @@ func (p *scenePager) getPageVideos(ctx context.Context, r SceneFinder, page int,
}
for _, s := range scenes {
if err := s.LoadPrimaryFile(ctx, f); err != nil {
return nil, err
}
objs = append(objs, sceneToContainer(s, p.parentID, host))
}