[Feature Request] detect metadata of pictures moved by external means
So there is a problem that we can't move folders around, described in this request: https://github.com/RupertAvery/DiffusionToolkit/issues/261
I thought about a different approach that wouldn't require to use the DiffusionToolkit to move things around. What about storing some hash value of a picture with it's metadata and when restoring pictures that were moved using external method compare that hash to restore metadata and locate "missing" pictures.
This is a good idea. One thing though is how would you handle duplicate images? There would have to be certain assumptions.
I suppose it shouldn't add too much time to scanning the image.
I'm compiling a list of cases that need to be tested. While they might seem the same, they might have different code paths (while some might share the same code path). One major difference is with different drives. For same-drive movement, the actual logic is more like renaming the file, no actual data gets rewritten. For different-drive movement, this is equivalent to a copy then delete.
The reason I've been holding off from supporting moving files is that it can be a bit complicated, and involves updating the data in a way that might leave the state of the database or the files inconsistent. That and the fact that I built Diffusion Toolkit so I would never have to worry about folders.
Assumptions
- The source and target folder locations are within a configured root folder.
- The user is performing actions outside of Diffusion Toolkit
- Running external programs that will perform batch renames is not tested
Tests
- Move Files - User selects files, then cuts and pastes the files in a different folder
- Move Folders - User selects folders, then cuts and pastes the folders in a different folder
- Move Mixed Files and Folders
- Rename File - The user selects a file and renames it (F2)
- Rename Folder - The user selects a folder and renames it (F2)
Need to also list down what the user expects to happen in Diffusion toolkit when such an action happens. i.e. updating the folder tree, refreshing the search results.
With Diffusion Toolkit Running, Watch Folders Enabled:
- Same Drive
- Move Files
- Move Folders
- Move Mixed Files and Folders
- Rename Files
- Rename Folders
- Different Drive
- Move Files
- Move Folders
With Diffusion Toolkit Closed, Folders Updated, then Rescan:
- Same Drive
- Move Files
- Rename Files
- Move Folders
- Rename Folders
- Different Drive
- Move Files
- Move Folders