Patch coming to cache thumbnails for files which are on removable media, on the removable media itself; and to continue to store other thumbnails in $XDG_CACHE_HOME as before.
See the commit message for more details.
Designs
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
This means the files don’t have to be re-thumbnailed for every computer
the drive is mounted on; and conversely, each computer doesn’t have to
worry about the cache lifetime of files on removable disks which it may
never see again.
It’s GError convention to set the GError exactly when returning FALSE
from a boolean-valued function. read_thumbnail_info() didn’t do that if
libpng reported an error loading the PNG; fix that by returning
TUMBLER_ERROR_INVALID_FORMAT in that case.
The thumbnail specification defines shared repositories as optional
read-only repositories stored relative to the media files, which can
therefore be shared between multiple users and computers. This could be
useful for removable media, for example.
Add read-only support for shared repositories, preferring to load the
thumbnail from the local repository ($XDG_CACHE_HOME/thumbnails), but
using the shared repository if that fails.
This means the files don’t have to be re-thumbnailed for every computer
the drive is mounted on; and conversely, each computer doesn’t have to
worry about the cache lifetime of files on removable disks which it may
never see again.
Here’s an updated patch set which splits out reading of thumbnails from writing of them, and separates the (potentially contentious) change to write to shared repositories into a commit of its own.
Updated patch to fix some URI-vs-path issues and add a bit more debug output.
The thumbnail specification defines shared repositories as optional
read-only repositories stored relative to the media files, which can
therefore be shared between multiple users and computers. This could be
useful for removable media, for example.
Add read-only support for shared repositories, preferring to load the
thumbnail from the local repository ($XDG_CACHE_HOME/thumbnails), but
using the shared repository if that fails.
This means the files don’t have to be re-thumbnailed for every computer
the drive is mounted on; and conversely, each computer doesn’t have to
worry about the cache lifetime of files on removable disks which it may
never see again.
Thanks for your patches, I reviewed them. I would take the first three patches for the moment. Unfortunately there is nothing in the specification about removable devices. Also I can see a couple of problems with saving thumbnails on removable devices.
Only in part: in particular, there is still the whole issue of deciding whether to save the thumbnails in a local or shared repository. I'll take a closer look at that.
The first one is now irrelevant, since it is a refactoring prior to the third patch, which is made obsolete (for the most part) by !17 (merged).
As for the fourth patch (and the part of the third one that is related to it), I am rather doubtful. Beyond Ali's remark, isn't it totally off-topic? According to the spec, shared repositories are supposed to be read-only (or considered as such). Besides, in the third patch, we refuse to clean up shared repositories because they are read-only, and then in the fourth patch we would write to them…
So shouldn't Tumbler stick to what has been implemented in !17 (merged)? Or maybe a separate feature should be considered, as proposed in #42, but I'm not sure if that should be considered...
Uh, yes, actually I did not see that "read only" part. So yes, according to the spec, tumbler only should read shared thumbnail repositories, but not generate them when the freedesktop.org DBus-Service is used.
Tumbler theoretically could provide an API to create shared thumbnails on an different D-Bus Service, e.g.org.xfce.Tumbler ( similar than thunar does via org.xfce.Thunar). Than other xfce applications could make use of that special service.
Though on the other hand, I dont know if it is worth the trouble. The script I linked in #42 should work for all thumbnailers which implement the fd.org standard .. if that is pimped to support all kind of uri's, it would be a more general solution.
I wonder if there are other applications around to just create a shared thumbnail repository using the freedesktop.org DBus-API. At least I did not find a straight-forward package to install and just do the job.