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 500034 - Save Rating and Play Count to files
Save Rating and Play Count to files
Status: RESOLVED DUPLICATE of bug 532650
Product: banshee
Classification: Other
Component: Metadata
Other Linux
: Normal enhancement
: 2.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 538770 (view as bug list)
Depends on:
Reported: 2007-11-27 18:44 UTC by Kaushik Veeraraghavan
Modified: 2009-01-13 22:32 UTC
See Also:
GNOME target: ---
GNOME version: ---

Import rating from ID3 tags (1.57 KB, patch)
2008-06-17 20:34 UTC, Stephan Ritscher
needs-work Details | Review
Import rating from ID3 tags (1.29 KB, patch)
2008-12-01 00:05 UTC, Stephan Ritscher
needs-work Details | Review
Import rating from ID3 tags (1.36 KB, patch)
2008-12-07 22:15 UTC, Stephan Ritscher
none Details | Review

Description Kaushik Veeraraghavan 2007-11-27 18:44:55 UTC
Under preferences, I opted for Banshee to write metadata to files.  However, I found that Banshee does not write "play count" to the ID3 tag of the mp3 that I'm playing.

Also, Banshee doesn't seem to read the existing play counts in files.  This is a problem as I am moving between players and won't have smart playlists any more.
Comment 1 Andrew Conkling 2007-11-27 23:34:03 UTC
This is interesting; I didn't even know such a thing were supported in ID3 tags. From a quick perusal, it seems that this isn't tracked by any other programs. Do you know of any programs that store the play count in the ID3 tags?
Comment 2 Kaushik Veeraraghavan 2007-11-28 05:08:11 UTC
No; I spent a while looking through popular Linux media players and didn't come across any that do track play count via updates to the ID3 tag.  I was really happy when I came across Banshee because it presented me with the option to "write metadata to file" which was something that no other player offered.  Note: There are ID3 parsers/editors like TagLib (, id3lib ( and eyed3 ( that can display and edit ID3 tag fields including the playcount and popularity-meter, but don't seem to be used by these players.

Most media players use a specialized database/library to track playcount, popularity etc, except I think that is wrong because it implies that people lose all the interesting attributes about their music.  This sucks when:
1) They move between media players and lose all their tags.
2) Their music player database gets corrupted and they lose all their tags because they backed up their music, but not the player database (

I guess the only reason not to do this would be if the music is available in a read-only manner (e.g.: a single multimedia storage server accessed over a LAN).
Comment 3 Gabriel Burt 2007-12-08 01:07:38 UTC
There was a bug with how we wrote Artist out to the files, but that's fixed now.  Renaming this bug to the part that's not yet fixed.

ID3v2 and TagLib# support saving the play count and rating in files.  Maybe this should be another option ('Write play counts and ratings to files') since it's saving personal information, essentially.

In terms of moving from one player to another, we have migrations that do that - what player are you coming from?
Comment 4 Stephan Ritscher 2008-06-12 13:42:34 UTC
mutagen (from quodlibet) can display such additional frames in mp3 headers. I used foobar in Windows which can create arbitrarily named tags. The tag "RATING" e.g. is displayed as "TXXX=RATING=4", so the type/name of the frame is "TXXX" and the value is "RATING=4".
I'd also love this option because all my music is already tagged!
Comment 5 Andrew Conkling 2008-06-17 14:24:20 UTC
*** Bug 538770 has been marked as a duplicate of this bug. ***
Comment 6 Stephan Ritscher 2008-06-17 20:34:50 UTC
Created attachment 112934 [details] [review]
Import rating from ID3 tags
Comment 7 Stephan Ritscher 2008-06-17 20:36:48 UTC
I created a patch that reads the rating from ID3v2 tags. It does NOT write changed ratings back to the file.
Please review the code - it's my first code in C#.
Greetings to all
Comment 8 Stephan Ritscher 2008-06-19 10:58:43 UTC
Unfortunately the importing gets quite slow by this patch. Any ideas why?
Comment 9 Gabriel Burt 2008-06-19 15:38:54 UTC
Ok, this was a problem with our API.  Setting the Rating of a DatabaseTrackInfo object was triggering it to Save, which is why things were slow.  I've committed a fix to trunk so that setting Rating doesn't automatically save (use SavedRating property if you want that behavior).  Sorry about that, svn up and things should be much faster!
Comment 10 Bertrand Lorentz 2008-08-15 19:08:12 UTC

Thank you for your patch.
There are a few code formatting issues (indentation, spacing, etc.). Please have a look at the HACKING file for all the details.

I also have a question : why is the line move in DatabaseImportManager.cs necessary ? I don't see the difference.
Comment 11 Stephan Ritscher 2008-08-28 15:47:31 UTC
If I remember right, there was an execution error (or maybe a performance problem) without this change. Maybe that changed in the new version.
I will have a look at it when I have more time.
Comment 12 Stephan Ritscher 2008-12-01 00:03:58 UTC
Ok, I'm sorry for the long time that has passed. Finally I made it to adapt the formatting style (as far as I recognized differences). It also seems that the change in DatabaseImportManager.cs is unnecessary, so I removed it. This version of the patch works with banshee 1.4.1.
Comment 13 Stephan Ritscher 2008-12-01 00:05:04 UTC
Created attachment 123715 [details] [review]
Import rating from ID3 tags
Comment 14 Adam Theo 2008-12-01 07:31:48 UTC
I would also really like to see ratings (or popularity-meter, whatever it is called in the metadata itself) written to files. However, my question is whether this is only really workable with mp3 audio files, or is this technique supported by other audio or video container formats (such as OGG, AVI, etc)?
Comment 15 Stephan Ritscher 2008-12-02 03:11:48 UTC
It should be possible with other containers as well. At least FLAC *natively* supports custom tags whereas in MP3 the solution is to add a user field consisting of the tag name, a separator and the tag data (at least on a low level).
Only the tag library doesn't support a convenient way of accessing custom tags for arbitrary containers (afaik), so you probably you would have to implement it for each format (or maybe for certain groups of formats).
I currently don't use banshee but foobar2000 (in VirtualBox) since I added another custom tag / column to my files / player and the updates to banshee would be rather involving (at least for me).
Comment 16 Bertrand Lorentz 2008-12-07 21:09:58 UTC
I have the following error when trying to compile with the patch :
Compiling Banshee.Core.dll...
./Banshee.Streaming/StreamTagger.cs(174,54): error CS0618: `TagLib.Id3v2.TextInformationFrame.FieldList' is obsolete: `Use TextInformationFrame.Text'
Compilation failed: 1 error(s), 0 warnings

I'm using mono 2.0.1 and taglib-sharp
Comment 17 Stephan Ritscher 2008-12-07 21:17:03 UTC
I was using mono 1.9.1 and I got only a warning (which I didn't notice) and the compilation finished successfully.
I'll have a look at it.
Comment 18 Stephan Ritscher 2008-12-07 22:15:56 UTC
Created attachment 124130 [details] [review]
Import rating from ID3 tags

I replaced the usage of the obsolete FieldList by a call of ToString. I don't like the solution because ToString contains the field description and the content, so I have to parse it, but I cannot see a better solution (except FieldList :-/).
Now it should compile without problems.
Comment 19 Gabriel Burt 2009-01-13 21:31:15 UTC
I think Nick's patch for this in bug #532650 does effectively the same thing (and more), does it not?  Stephan, is there anything his patch should take from yours?
Comment 20 Stephan Ritscher 2009-01-13 22:19:52 UTC
Not really. I still miss a feature to display an user defined tag in an extra column, but that's another story.
Comment 21 Gabriel Burt 2009-01-13 22:32:41 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of 532650 ***