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

@@ -84,8 +84,7 @@ func (c *fingerprintCalculator) CalculateFingerprints(f *file.BaseFile, o file.O
ret = append(ret, *fp)
// only calculate MD5 if enabled in config
// always re-calculate MD5 if the file already has it
calculateMD5 = c.Config.IsCalculateMD5() || f.Fingerprints.For(file.FingerprintTypeMD5) != nil
calculateMD5 = c.Config.IsCalculateMD5()
}
if calculateMD5 {