[Bug Report] Moved files check uses MD5 in addition to OSHASH when detecting moved files
Describe the bug When checking if a file has been renamed, if MD5 hashing is enabled, it will be used alongside OSHASH in searching for the file, even after the OSHASH has been confirmed
To Reproduce Steps to reproduce the behavior:
- Enabled
Calculate MD5 for videos - Scan in a large file (40GB)
- Notice that it has MD5 and OSHASH
- Rename file
- Upon rescanning, activate trace and see that it's using MD5 as well
Expected behavior On file move, only OSHASH is used instead of both OSHASH and MD5
Screenshots full debug log available upon request, truncated for brevity
2024-07-03 23:40:11
Info
/media/stash/largefile.mp4 moved to /media/stash/largefile_new.mp4. Updating path...
2024-07-03 23:40:11
Trace
SQL [112.41µs]: SELECT `files`.`id`
[ TRUNCATED ]
args: [md5 00000000000000000000000000000000]
2024-07-03 23:40:11
Trace
SQL [5.044433ms]: SELECT `files`.`id`
[ TRUNCATED ]
args: [oshash 0000000000000000]
2024-07-03 23:39:29
Info
Calculating fingerprints for /media/stash/largefile_new.mp4 ...
2024-07-03 23:39:29
Trace
SQL [123.771µs]: SELECT `files`.`id`
[ TRUNCATED ]
WHERE ((`folders`.`path` = ?) AND (`files`.`basename` = ?)), args: [/media/stash/largefile_new.mp4]
2024-07-03 23:39:29
Info
Finished adding files to queue. 2729 files queued
Stash Version: (from Settings -> About): v0.26.2-35-g4cca3b29
Additional context
I've only noticed this after churning through renaming large files. I can see the usefulness but it might be better reserved as part of image generation
https://github.com/stashapp/stash/blob/51999135be14687527750ba12a05abc46fef487a/pkg/models/fingerprint.go#L95-L105
Any reason why this shouldn't short circuit early if one of the conditions is already true https://github.com/stashapp/stash/pull/2945