Bug 510276

Summary: Moving folder causes recursive copy
Product: [Applications] digikam Reporter: HubMiner <cal030>
Component: Database-AlbumsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.7.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.8.0
Sentry Crash Report:

Description HubMiner 2025-10-05 19:41:42 UTC
SUMMARY

Sometimes copying directories across DK collections causes it to create a set of endless subdirectories, each with copies of the same images.  I am not sure how to reproduce this - what triggers this, possibly asking to move a direcoty while something else is in progress (lazy sync).  I observed this behavior multiple times.  


STEPS

Identify a leaf folder with a few image files
Maybe start a lazy sync in the same folder (update a test tag for all images there)
In DK, drag the folder from one collection to another
Observe that "move" status bar is showing this is taking long time
Close and terminate DK
Find the source (not target!) folder localtion.
If the issue was triggered, you would see endless nested directories (100+ levels), each with copies of the files.


RECOVERY

Deletion is successful only with Windows "rmdir" command, GUI based approach does not work.
Comment 1 Maik Qualmann 2025-10-05 19:46:47 UTC
A recursive album move/copy detection is added in digiKam-8.8.0:

https://invent.kde.org/graphics/digikam/-/commit/dcc48cc8711fdb3064050e8871c118243fbd036a

Maik
Comment 2 Maik Qualmann 2025-10-05 20:02:22 UTC
One more tip: you should definitely not move folders to which metadata is currently being written. On the one hand, Windows file locking blocks further actions, and the metadata may not be synchronized because files have been moved. Wait until the actions are complete. We'll never be able to protect each task other.

Maik