Bug 364614 - images/albums not deleted in database when deleting/moving in digikam
Summary: images/albums not deleted in database when deleting/moving in digikam
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Trash (show other bugs)
Version: 5.0.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 21:08 UTC by Johannes Hirte
Modified: 2019-07-26 17:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Hirte 2016-06-21 21:08:19 UTC
the bug is reported against digikam master

Images and albums are not deleted within the database (mysql) when they're (re-)moved. Following example:

One collection (digikam5-test) with one album (dir1) and one picture (crop_000010a-fixed.png). 

the Albums table contains two entries: 
id 1; relativePath /
id 2;  relativePath /dir1

the Images table has one entry:
id 1; album 2; name crop_000010a-fixed.png; status 1

Now creating a new album dir2 and moving the picture there:

the Albums table contains three entries: 
id 1; relativePath /
id 2;  relativePath /dir1
id 3; relativePath /dir2

the Images table has two entries:
id 1; album NULL; name crop_000010a-fixed.png; status 3
id 2; album 2; name crop_000010a-fixed.png; status 1

Now deleting album 2 with the picture:

the Albums table still contains three entries: 
id 1; relativePath /
id 2;  relativePath /dir1
id 3; relativePath /dir2

the Images table has still two entries:
id 1; album NULL; name crop_000010a-fixed.png; status 3
id 2; album NULL; name crop_000010a-fixed.png; status 3

The image and the directory (dir2) are deleted within the filesystem. The images is also gone in digikam. I think the reason for this is status 3 or album NULL. The album (dir2) is still shown in digikam with no content.  When selecting it, digikam shows the error when started on commandline:
digikam.database: Folder does not exist or is not readable:  "/home/pictures/digikam5-test/dir2"

So at least the handling of deleted albums is broken. But the whole handling of deleted items looks broken to me. Why are they kept for all time within the db? A picture or album removed from the collection has to be removed from the db too. A moved item has to be updated, not inserted new. At moment, the database is growing with orphaned items nobody will ever need again.

I didn't had the problems with still shown albums after deletion with digikam4. But I think the problem of newly created db entries with every move of an item already existed there.

Reproducible: Always
Comment 1 swatilodha27 2016-06-21 22:02:15 UTC

*** This bug has been marked as a duplicate of bug 363697 ***
Comment 2 swatilodha27 2016-06-21 22:04:53 UTC

*** This bug has been marked as a duplicate of bug 363697 ***
Comment 3 caulier.gilles 2019-07-26 17:28:05 UTC
Fixed with bug #363697