mirror of
https://github.com/stashapp/stash.git
synced 2026-02-15 03:21:38 -06:00
Fix duplicate file detection in zip archives (#6493)
When scanning a zip archive duplicate images are being detected as renames rather than duplicates. This is because in `scanJob.getFileFS` the size of the inner file (`my_archive.zip/001.png`) was being passed to `OpenZip` rather than the size of the zip archive (`my_archive.zip`), causing it to fail when opening the archive. This caused `handleRename` to incorrectly detect it as a rename. The effects of that are: - no info on duplicates in the file data - the file will take the name/path of the final duplicate scanned rather than the first
This commit is contained in:
committed by
GitHub
parent
d7d7530c78
commit
2a5b59a96a
@@ -895,7 +895,8 @@ func (s *scanJob) getFileFS(f *models.BaseFile) (models.FS, error) {
|
||||
}
|
||||
|
||||
zipPath := f.ZipFile.Base().Path
|
||||
return fs.OpenZip(zipPath, f.Size)
|
||||
zipSize := f.ZipFile.Base().Size
|
||||
return fs.OpenZip(zipPath, zipSize)
|
||||
}
|
||||
|
||||
func (s *scanJob) handleRename(ctx context.Context, f models.File, fp []models.Fingerprint) (models.File, error) {
|
||||
|
||||
Reference in New Issue
Block a user