TagStudioDev / TagStudio

A User-Focused Photo & File Management System
GNU General Public License v3.0
4.68k stars 355 forks source link

Deleting of a picture doesn't removes it from the library (FileNotFoundError) #248

Open feuillemorte opened 3 months ago

feuillemorte commented 3 months ago

Description: Deleting of a picture doesn't removes it from the library

Environment: MacOS Version: commit fb445e6ab0fed7a3f0ad96db4a38b064ea02d814

Steps to reproduce:

  1. Open a library in the TagStudio
  2. Paste a picture to the library folder using Finder
  3. Refresh directories in the TagStudio and see that the picture is shown in the interface
  4. Remove the picture from the library folder using Finder
  5. Refresh directories in the TagStudio

Expected result: Picture is no longer presented in the interface

Actual result: There is a picture with the tag (see screenshot) and there is no way to delete it.

Screenshot 2024-05-30

Logs:

[ThumbRenderer][ERROR]: Couldn't render thumbnail for Screenshot 2024-05-30 at 14.40.44.png (FileNotFoundError)
[PreviewPanel][ERROR] Couldn't Render thumbnail for /Users/user/library/Screenshot 2024-05-30 at 14.40.44.png (because of [Errno 2] No such file or directory: '/Users/user/library/Screenshot 2024-05-30 at 14.40.44.png')

P.S. Sorry if that was already reported, I couldn't find anything similar

Loran425 commented 3 months ago

First off thanks for the clear write up of your environment and how to replicate the issue. There are some considerations to address this in the future, but nothing concrete on the intended behavior at this time.

The current way to resolve this is the Tools > Fix Unlinked Entries tool image

From there you can click refresh all to locate the unlinked entries then either use Search & Relink to attempt to relink the entry (would fail in the case of a deleted file) or Delete Unlinked Entries which will clear the invalid entries. image

CyanVoxel commented 3 months ago

Loran is correct here, this is the current workflow for handling moved/renamed/deleted files. Right now the program doesn't know the difference between any of those three scenarios, so it presents you with the upfront knowledge that entries are somehow unlinked while providing some basic tools for attempting to automatically relink them or to pull the trigger on deleting them from your library.

Once some smarter systems are in place for automatic relinking and informing the user of issues, then this should be less of an obstructive process.

feuillemorte commented 3 months ago

Oh, I'm very sorry to report the intended behaviour! I didn't expect to fix the problem that way. I was personally expecting it to disappear automatically or have a delete button on a picture tile. But I can see now that there is much more complicated logic behind.

Thank you for providing the correct workflow! Do you think it would be a good idea to add a small message to the side on what to do when you click on such a picture tile? Like "the original file might be deleted, renamed or moved, to fix it go to this menu"

CyanVoxel commented 3 months ago

Oh, I'm very sorry to report the intended behaviour! I didn't expect to fix the problem that way. I was personally expecting it to disappear automatically or have a delete button on a picture tile. But I can see now that there is much more complicated logic behind.

Thank you for providing the correct workflow! Do you think it would be a good idea to add a small message to the side on what to do when you click on such a picture tile? Like "the original file might be deleted, renamed or moved, to fix it go to this menu"

Don't be sorry! It's a quirky part of the program at this stage of development. And yes, it would be a very good idea for us to at least communicate to the user with a message describing what's happened with possibly even a button to open the dialogue window to try and fix it.