deleting album and its photos may generate missing files #2099

Open
opened 2026-10-05 01:06:19 +02:00 by adam · 1 comment
Owner

When you have a huge album (with thousands of photos), if you delete the album and the photos it contains...

Image

... it may end up with missing photos. Meaning the files have been removed from filesystem, but the photo is still listed in the database.

We think it's because the file deletion occurs before the deletion of lines in tables. If there are too many files to delete, the PHP script takes too long and fails with timeout. The files are partly deleted and no line is removed from tables.

Solution : when there are too many photos in the album you want to delete, simply tell the user that photos will become orphans and can be removed from the Batch Manager.

When you have a huge album (with thousands of photos), if you delete the album and the photos it contains... <img width="703" height="319" alt="Image" src="https://github.com/user-attachments/assets/78f40773-54bf-45c1-bd48-88112458abe5" /> ... it may end up with missing photos. Meaning the files have been removed from filesystem, but the photo is still listed in the database. We think it's because the file deletion occurs before the deletion of lines in tables. If there are too many files to delete, the PHP script takes too long and fails with timeout. The files are partly deleted and no line is removed from tables. Solution : when there are too many photos in the album you want to delete, simply tell the user that photos will become orphans and can be removed from the Batch Manager. <!-- github-sync-id:3499642688 -->
Author
Owner

In Lightroom, we have to delete pictures BEFORE deleting the album. So it's maybe a better idea to explain and force user to delete the pictures first :)

In _Lightroom_, we have to delete pictures BEFORE deleting the album. So it's maybe a better idea to explain and force user to delete the pictures first :) <!-- github-comment-id:3676023354 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#2099