Bug 405234 - Refresh does no work
Summary: Refresh does no work
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-IconView (show other bugs)
Version: 6.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-08 18:02 UTC by harald.aust
Modified: 2019-03-15 18:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.0


Attachments
digiKam Log (60.91 KB, text/plain)
2019-03-13 12:14 UTC, harald.aust
Details
Log when doing a manual Refresh (185.11 KB, text/plain)
2019-03-13 12:21 UTC, harald.aust
Details

Note You need to log in before you can comment on or make changes to this bug.
Description harald.aust 2019-03-08 18:02:18 UTC
SUMMARY
Refresh of folders whose contents have been changed outside digiKam does not work.


STEPS TO REPRODUCE
1. Outside digiKam, rename a picture that is in a digiKam album.
2. Hit F5, or select View/Refresh, or chooses Refresh from the album's context menu.


OBSERVED RESULT
digiKam reports 100% done on "find new items", but it doesn't change anything in the Thumbnails.

EXPECTED RESULT
Thumbnails are refreshed according to what files there really are.


SOFTWARE/OS VERSIONS
Windows: Win7 32 bit
 

ADDITIONAL INFORMATION
Doing Tools/Maintenance/Scan for new Items *does* work.
Comment 1 Maik Qualmann 2019-03-08 18:33:27 UTC
What are you doing exactly. If an image is just renamed, there will be create no new thumbnail. Rename you a image that previously had the name of another image?

Maik
Comment 2 harald.aust 2019-03-10 13:42:04 UTC
- Album exists in digiKam. File names and rating are shown below thumbnails.
- In Windows explorer, I rename file DSC06838.jpg to DSC06838a.jpg. (So I'd assume that to digiKam this appears as one file deleted, one file added to the album).
- Also, in Windows explorer, I change the rating of file DSC06839.jpg from 4 stars to one star.
- In digiKam, I do "Refresh". I get message "Find new items / Thumbs 100% done". But neither filename nor rating has changed.
- In digKam, I do Tools/Maintenance/Scan for new items. Now, both filename and rating are corrected.

Maybe "Refresh" works as intended, but if it does, what is it for? It doesn't seem to do anything. I would have expected the behavior I get with Tools/Maintenance/Scan for new items.

Best regards,
Harald
Comment 3 harald.aust 2019-03-10 13:45:15 UTC
Tried another thing.

- In Windows explorer, added a file to the album directory.
- "Refresh" => no visible result.
- "Tools/Maintenance/Scan" => new picture shows up in album.

Best regards,
Harald
Comment 4 Maik Qualmann 2019-03-10 14:33:11 UTC
Are the images on a network drive or local drive?

This works here on Windows:
- rename external file -> also renamed after 1 second in digiKam
- file added under Explorer -> after 1 second in digiKam also added

What does not work, externally change a rating, the QFileSystemWatcher sends no signal to digiKam. This is a difference to the Linux version.

Maik
Comment 5 harald.aust 2019-03-10 14:52:58 UTC
Local drive.

What you write sounds like an automatic scan for changes. How to enable this so I could try it? (Sorry, I'm new to digiKam.) What happens when you disable the automatic scan and press F5?

I just tried "Scan for new items at startup"; that also works, both for renamed file and for rating.

Regards,
Harald
Comment 6 Maik Qualmann 2019-03-10 17:29:23 UTC
Each album is automatically monitored for changes in the folder. It is not configurable. Therefore, I am surprised that it does not work for you. Can you download and start DebugView from Microsoft? Then post the output if you add a new file to an album while running digiKam.

Maik
Comment 7 harald.aust 2019-03-13 12:14:17 UTC
Created attachment 118769 [details]
digiKam Log

Hi,

Interesting tool -- hadn't heard of it before.

The file name in line 466 is correct. The file name in line 468 is not -- somehow a second "Schottland" gets inserted.

Hope this helps, and best regards,
Harald
Comment 8 harald.aust 2019-03-13 12:15:49 UTC
Of course, "file name" should have been "folder name", but I'm sure you guessed that.
Comment 9 harald.aust 2019-03-13 12:21:57 UTC
Created attachment 118770 [details]
Log when doing a manual Refresh

The same log as above, but continued. This is how a manual "Refresh" is logged.

Best regards,
Harald
Comment 10 Maik Qualmann 2019-03-13 22:00:25 UTC
Thank you for the log file. I can reproduce the problem not only under Windows but also under Linux. The cause is that both collections start with the same name. The bad function is CollectionManager::album(QString). I will fix it tomorrow.

@Gilles, this Windows computer also takes almost 35 seconds to load the plugins. It's up to the size of the plugins, maybe we should provide a 64 bit version without a debug code.

Maik
Comment 11 Maik Qualmann 2019-03-13 22:29:59 UTC
Git commit c2d993ef70086ee518be04f7175835774493b0d5 by Maik Qualmann.
Committed on 13/03/2019 at 22:28.
Pushed by mqualmann into branch 'master'.

quick fix for the album path problem

M  +1    -1    core/libs/database/collection/collectionmanager_album.cpp

https://commits.kde.org/digikam/c2d993ef70086ee518be04f7175835774493b0d5
Comment 12 Maik Qualmann 2019-03-13 22:33:01 UTC
This is just a quick fix. I do not close the bug yet, because I want to improve the function even more.

Maik
Comment 13 Maik Qualmann 2019-03-14 07:04:16 UTC
Git commit 8e1e94582720c6b52948f0a7a8b4692f3b78600c by Maik Qualmann.
Committed on 14/03/2019 at 07:03.
Pushed by mqualmann into branch 'master'.

fix getting album from the correct location path
FIXED-IN: 6.1.0

M  +2    -1    NEWS
M  +11   -17   core/libs/database/collection/collectionmanager_album.cpp

https://commits.kde.org/digikam/8e1e94582720c6b52948f0a7a8b4692f3b78600c
Comment 14 caulier.gilles 2019-03-14 07:12:15 UTC
>@Gilles, this Windows computer also takes almost 35 seconds to load the plugins. It's >up to the size of the plugins, maybe we should provide a 64 bit version without a >debug code.

I recommend to host debug symbols in pre-version bundles as we can expect bugs until final release.

At official release, we can drop debug symbols from dll. In fact it's optional and already implemented since a very long time in bash scripts :

https://cgit.kde.org/digikam.git/tree/project/bundles/mxe/config.sh#n70

Gilles
Comment 15 caulier.gilles 2019-03-14 07:15:23 UTC
Harald,

The last fixes from Maik will be available in 6.1.0 pre release Windows installer which are under construction on my computer. This will take 2 hours to compile and upload files here :

https://files.kde.org/digikam/

Gilles Caulier
Comment 16 Maik Qualmann 2019-03-14 07:34:36 UTC
@Gilles
Yes, I always create my windows test builds without debug code. Therefore, I found that Windows is very slow to load the plugin when these are several megabytes in size. Without debug symbols it is very fast. This problem occurs less in a virtual machine.

Maik
Comment 17 caulier.gilles 2019-03-14 11:01:16 UTC
Maik,

Here, with my old laptop Dell Latitude E6340, Ruuning Linux as host and Windows 7 in Virtual box, this take 5s to load digiKam :

https://drive.google.com/file/d/1eyUY-rhStkz8ZlnJz7h_q2fFcqye6SMH/view?usp=sharing

Gilles
Comment 18 Maik Qualmann 2019-03-14 11:34:31 UTC
Right, here in a virtual machine as well. So far, I have only seen the long loading time on real Windows machines.

Maik
Comment 19 harald.aust 2019-03-15 16:16:50 UTC
Maik,

The following is for digiKam-6.1.0-git-20190315T074305-Win32.

- Automatic monitoring now works :-) As you wrote, new files are discovered after 1 second or so; changes in tags (rating) are not discovered.

- Triggering Refresh manually now works and also discovers tag changes. However, it's extremely slow (8 minutes (yes) for a database of just 360 pictures), so I'd say its practical use is limited...

- Doing Tools/Maintenance/Scan still works and takes only 1 second.

Best regards,

Harald
Comment 20 harald.aust 2019-03-15 16:20:48 UTC
Regarding load time,

My machine is an 11-year-old laptop without SSD. It runs perfectly, but it is still an 11-year-old laptop without SSD.

And digiKam is not exactly small, so I wouldn't expect miracles. Nonetheless, it normally loads in less than 10 seconds. Only immediately after installation it seems to take significantly longer.

Kind regards,

Harald
Comment 21 Maik Qualmann 2019-03-15 18:41:13 UTC
To change the rating externally, the Metadata option "Reread metadata if the files were changed" should be activated. We monitor the directory, which means the new / no longer existing files, changed name and file size is detected. If the file already had a rating, there is no resizing and digiKam will not be notified. Monitoring all files would consume the system resources. It would be possible to monitor only the currently active album completely. We would not notice changes in other albums. But actually you should change the rating in digiKam. :-)
If the refresh with F5 takes too long because thumbnails are also rebuilt, try Album-> Reread Metadata from files.

Maik