Bug 231598

Summary: Metadata on Albums are lost when album moved from local collection to a network collection
Product: [Applications] digikam Reporter: Vincent Tassy <timetre>
Component: Database-MediaAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, timetre
Priority: NOR    
Version: 2.5.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Unspecified   
Latest Commit: Version Fixed In: 1.3.0
Sentry Crash Report:
Attachments: Debug statements
debug output as per patch provided by marcel

Description Vincent Tassy 2010-03-21 23:01:42 UTC
Version:            (using KDE 4.4.1)
Installed from:    Fedora RPMs

I have 2 collection defined (one local one and one on a NAS).
If I set the properties of an album in the local collection (I set date, category, caption, thumbnail) and then move that album to my second collection (on the NAS) the properties of the album are lost and I have to set them again ...
Comment 1 caulier.gilles 2010-03-22 09:44:42 UTC
Which digiKam version you use exactly ? Go to help/About dialog for details

Gilles Caulier
Comment 2 Vincent Tassy 2010-03-22 10:35:14 UTC
I'm currently using 1.1.0 on Fedora 12 but it's been behaving like this for as long as I can remember ...
Comment 3 Marcel Wiesweg 2010-04-18 16:24:16 UTC
SVN commit 1116055 by mwiesweg:

When reading the album move hints and looking for the src collection, dont look it up
in the list of currently scanned collections, but in the list of all collections -
the src collection may be scanned previously or later.

BUG: 231598

 M  +2 -1      NEWS  
 M  +7 -5      libs/database/collectionscanner.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1116055
Comment 4 Vincent Tassy 2011-12-19 10:26:55 UTC
Team,

I'm afraid the problem is still present ... Didn't realise this bug was closed.
Problem was still present in 1.9
Problem is still present in 2.3
Comment 5 caulier.gilles 2011-12-19 10:31:03 UTC
Please try with last 2.4 release...

Gilles Caulier
Comment 6 Vincent Tassy 2011-12-22 10:03:52 UTC
Bug is still present in 2.4.1
Comment 7 Vincent Tassy 2011-12-22 10:21:11 UTC
I looked into the problem a little more ...
I would have thought that when an album is moved from one collection to another, its record in the the Albums database would be updated ... in particular the albumRoot and relativePath fields but that the other fields (date, caption, collection, icon) would be preserved.

It seems it's not the case !!
A new row is created for the moved Album and don't contain the previous meta-data !

Here's an example:
Prior to the move:
id  |albumRoot|relativePath|date      |caption|collection|icon
2102|1        |/Test       |2011-12-09|       |FĂȘte      |96451

after the move:
id  |albumRoot|relativePath|date      |caption|collection|icon
2102|0        |1-/Test     |2011-12-09|       |FĂȘte      |96451              
2103|2        |/2011/Test  |2011-12-22|       |          |
Comment 8 Vincent Tassy 2011-12-22 16:39:16 UTC
More insight ...
The problem doesn't occur if both the source and the destination Collections are "Local Collections"

On my setup, I have one "Local Collection" and one "Collection on Network Shares"
which is a NAS I have mounted through NFS.

I get the problem only when I move albums between those two .. local to network or network to local.
Comment 9 caulier.gilles 2011-12-22 16:42:21 UTC
Vincent,

You use which version of digiKam ?

Gilles Caulier
Comment 10 Vincent Tassy 2011-12-22 17:36:04 UTC
I use 2.4.1
Comment 11 Marcel Wiesweg 2011-12-26 20:49:20 UTC
Vincent, would you be ready to compile digikam with a patch with debug statement I would prepare for you? I'm not sure what is the problem with NAS collections in this context.
Comment 12 Vincent Tassy 2011-12-27 09:34:57 UTC
Yes Marcel, no problem. I've compiled Digikam before.
I might not have time to do it this week but I'll get on it as soon as I can.
Comment 13 Marcel Wiesweg 2012-05-21 15:50:52 UTC
Created attachment 71265 [details]
Debug statements

Sorry for long delay. First step to gain more insight with some debug statements. Move one album from within digikam as described, give console output (enable 50003 in kdebugdialog) starting with the move. Thanks.
Comment 14 Vincent Tassy 2012-05-22 21:08:09 UTC
Well, guess what,

I compiled the version from git and the bug is now gone !!

I tried version 2.5.0 on the same system and same data just before and the bug was still there.
2.6.0 out of git works like a charm so I'll go ahead and close the bug as fixed.
Good job !
Comment 15 Vincent Tassy 2012-05-22 21:10:37 UTC
Created attachment 71301 [details]
debug output as per patch provided by marcel

console output when moving a folder from a collection to another location (network share)