After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 502006 - please use ~/.cache/ for large files like song_info.xml or rhythmdb.xml
please use ~/.cache/ for large files like song_info.xml or rhythmdb.xml
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
0.11.x
Other Linux
: Normal minor
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-06 11:19 UTC by Martin Pitt
Modified: 2009-02-23 00:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Move ~/.gnome2/rhythmbox/covers/ to ~/.cache/rhythmbox/covers/ (1.44 KB, patch)
2008-03-26 19:23 UTC, Andreas Henriksson
needs-work Details | Review
new version of patch for Cover Plugin using XDG_CACHE_HOME dir. (1.39 KB, patch)
2008-05-15 11:08 UTC, Andreas Henriksson
committed Details | Review

Description Martin Pitt 2007-12-06 11:19:50 UTC
Hi!

First, thanks for the really great integration of Magnatune/Jamendo. I discovered that feature yesterday and loved it (already bought an album). Just today I discovered that my daily backup grew larger by quite much.

RB currently stores its downloaded catalogs, as well as rhythmdb.xml to .gnome2/rhythmbox/. Since all of these aren't precious files, but just caches, it would be much preferable to put them into ~/.cache/rhythmbox/, so that they don't land in backups.

Thanks for considering,

Martin
Comment 1 Jonathan Matthew 2007-12-06 11:26:46 UTC
I'm not sure if rhythmdb.xml should go there.  Many users consider song ratings and play counts to be valuable data.
Comment 2 Martin Pitt 2007-12-06 12:36:47 UTC
Oh, song ratings/play counts indeed are. I thought that was the file which has the index of the music collection (i. e. paths and extraction of the mp3/ogg metadata such as artist, title, etc.). I did not find any rating in there. If that is indeed stored in the same file, then it needs to stay. (Although it would be preferable to keep the user defined metadata separate from the file/tag info).
Comment 3 Andreas Henriksson 2008-03-26 18:07:30 UTC
My suggestion for moving to cache would be ~/.gnome2/rhythmbox/covers/
These can all be (automagically!) downloaded again if lost in a crash, nothing that needs to be backed up.
Comment 4 Andreas Henriksson 2008-03-26 19:23:00 UTC
Created attachment 108084 [details] [review]
Move ~/.gnome2/rhythmbox/covers/ to ~/.cache/rhythmbox/covers/

Change ART_FOLDER to ~/.cache/rhythmbox/covers/ in artdisplay-plugin, also add code to migrate ~/.gnome2/rhythmbox/covers/ if needed.

(IMHO the rest of ~/.gnome2/rhythmbox/ should be moved to ~/.config/rhythmbox/, and if this is done the OLD_ART_FOLDER might need to be updated depending on which migration is done first...)
Comment 5 Jonathan Matthew 2008-05-15 00:52:45 UTC
Apparently we should check for the XDG_CACHE_HOME environment variable, and only use ~/.cache if that doesn't exist.
Comment 6 Andreas Henriksson 2008-05-15 11:08:12 UTC
Created attachment 110949 [details] [review]
new version of patch for Cover Plugin using XDG_CACHE_HOME dir.

Now the new location takes the environment variables XDG_CACHE_HOME (and falls back on constructing it from XDG_HOME_DIR, HOME or ~ + .cache if it doesn't exist). 
The old art folder is still hardcocded, since it was always hardcoded and not dependent on any environment varibales. Only new location updated.
Comment 7 Christophe Fergeau 2008-05-17 15:21:40 UTC
Shouldn't we use g_get_user_cache_dir () instead of directly querying XDG_CACHE_HOME ?
Comment 8 Tino Meinen 2008-05-20 02:48:59 UTC
(In reply to comment #3)
> My suggestion for moving to cache would be ~/.gnome2/rhythmbox/covers/
> These can all be (automagically!) downloaded again if lost in a crash, nothing
> that needs to be backed up.
> 

If your music collection contains a lot of non-mainstream music you'll be in trouble. The cover art plugin didn't find half of my cd's. I've spent many, many hours searching the internet for covers of my cd's. I still have 82 to go. I might go visit someone with a scanner to do this last remaining batch.

No, I wouldn't want to repeat that all over again in case of a crash. (I've already made a backup of those files).

The original reporter of the bug wrote that his daily backup started 'growing by quite much' because big files were landing in his backups.
Instead of patching rhythmbox, I would suggest to fix the backup software, or simply adjust the settings of the backup software to exclude the paths to the rhythmbox files.
Comment 9 Jonathan Matthew 2008-05-20 03:17:35 UTC
(In reply to comment #8)
> If your music collection contains a lot of non-mainstream music you'll be in
> trouble. The cover art plugin didn't find half of my cd's. I've spent many,
> many hours searching the internet for covers of my cd's. I still have 82 to go.
> I might go visit someone with a scanner to do this last remaining batch.

You're not meant to do this by placing files directly in ~/.gnome2/rhythmbox/covers.  That directory is a cache, and the file naming scheme is an implementation detail.

> No, I wouldn't want to repeat that all over again in case of a crash. (I've
> already made a backup of those files).
> 
> The original reporter of the bug wrote that his daily backup started 'growing
> by quite much' because big files were landing in his backups.
> Instead of patching rhythmbox, I would suggest to fix the backup software, or
> simply adjust the settings of the backup software to exclude the paths to the
> rhythmbox files.

One of the main reasons to make this change is so that people don't have to configure their backup software.

Comment 10 Andreas Henriksson 2008-05-20 05:07:32 UTC
Tino, feel free to include ~/.cache/ in your backup!
I don't think your usecase is the general situation. People who download covers manually probably rather put them in the music folder along with the music files.
Doing the ~/.config vs ~/.cache split is simply to help people who want to keep their backups minimal. There's nothing saying you can't backup both if don't want to lose any files.

Comment 11 Martin Pitt 2008-05-20 07:06:53 UTC
(In reply to comment #8)
> The original reporter of the bug wrote that his daily backup started 'growing
> by quite much' because big files were landing in his backups.
> Instead of patching rhythmbox, I would suggest to fix the backup software, or
> simply adjust the settings of the backup software to exclude the paths to the
> rhythmbox files.

It's not about "fixing" my backup software, that works just fine. The question is about *not* having to configure it to such a fine-grained level to mention each and every file. Applications know themselves which files a precious and which are just cache, so they should put their stuff into standard directories. That way, backup software can come with sane defaults and be efficient.

So if you have 'precious' CD covers, they should not go into the cache directory, ideally.

Comment 12 Tino Meinen 2008-05-20 11:05:00 UTC
Okay, understood, thanks for the explanations everybody! I'll start moving my covers to the music folders.
Comment 13 Jonathan Matthew 2008-06-08 08:02:07 UTC
Looks good and, from my limited testing, seems to work.  I'll commit it once the current svn maintenance is done.  Thanks for the patch.
Comment 14 David Siegel 2008-11-19 23:52:02 UTC
Banshee uses XDG_CACHE_HOME/album-art, and it also sanitizes the artist and album names in the file name (artist-album.jpg). While updating Rhythmbox support in GNOME Do, I realized that it would be excellent if Rhythmbox and Banshee (and other XDG-compliant music applications) stored their album art in the same XDG_CACHE_HOME subdirectory.
Comment 15 Christophe Fergeau 2008-11-20 00:14:42 UTC
Banshee will probably soon use http://live.gnome.org/MediaArtStorageSpec I guess ;)
Comment 16 Jonathan Matthew 2009-02-23 00:03:28 UTC
Magnatune and jamendo catalogues have moved to the user cache dir, magnatune in-progress downloads have moved to the user data dir, and as far as I can tell there's nothing left in ~/.gnome2/rhythmbox/.