[Bug Report] Deleting a duplicated gallery makes all images of the remaining gallery disappear
Describe the bug Having two indexed image galleries with the same files inside (same CRC), if you delete one of them, with this option:
Delete gallery folder/zip file and any images not attached to any other gallery.
All reference to the images in the remaining gallery disappear, only files that where not duplicated remain The files are still on the disk, but they cannot be reindexed unless you delete the gallery with the option
Delete generated supporting files
And scan the folder again
I work with zip file galleries, but I'm quite sure that it happens with normal folders too. The problem is how the program manages and indexes duplicated files
To Reproduce Steps to reproduce the behavior:
- Put some image files in a zip file, name it Gallery 1
- Duplicate the zip file, so you end up with Gallery1.zip and Gallery2.zip
- Scan
- Two new galleries will appear
- Remove Gallery 2, checking the option "Delete gallery folder/zip file and any images not attached to any other gallery.". Gallery 2.zip disappears from dik, Gallery1.zip still there
- Open Gallery 1 in stash
- It's now empty, no files, no thumbnails
Expected behavior Deleting a gallery that has duplicated images should check and only decrement the image count if the image it's present in another one, i.e. from 2 to 1, not remove all references
Stash Version: (from Settings -> About): v0.22.1
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
Additional context I think this is related to another bug I submited some time ago: https://github.com/stashapp/stash/issues/3849. Duplicated images should not affect the behaviour of a gallery
FWIW, I tried to reproduce this in a Chromium-based browser (Arc) running against Stash v0.23.0 today, and could not. (Just the 1 gallery I deleted was properly removed - the other remained, with all duplicate images intact.)