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

@@ -50,7 +50,7 @@ func (e *DirEntry) info(fs FS, path string) (fs.FileInfo, error) {
// File represents a file in the file system.
type File interface {
Base() *BaseFile
SetFingerprints(fp []Fingerprint)
SetFingerprints(fp Fingerprints)
Open(fs FS) (io.ReadCloser, error)
}
@@ -76,7 +76,7 @@ type BaseFile struct {
// SetFingerprints sets the fingerprints of the file.
// If a fingerprint of the same type already exists, it is overwritten.
func (f *BaseFile) SetFingerprints(fp []Fingerprint) {
func (f *BaseFile) SetFingerprints(fp Fingerprints) {
for _, v := range fp {
f.SetFingerprint(v)
}