Open DeusIX opened 4 years ago
First, playcount and rating can be saved, though using the fmps standard, which might not be widespread (I really have no clue).
You should be able to edit a few lines to achieve what you want, as an example, here is the definitions for the rating field:
rating =>
{ name => _"Rating", width => 80, flags => 'fgaescp', type => 'rating',
id3v2 => 'TXXX;FMPS_Rating_User;%v::%i & TXXX;FMPS_Rating;%v | percent( TXXX;gmbrating;%v ) | five( TXXX;rating;%v )',
vorbis => 'FMPS_RATING_USER::%i & FMPS_RATING | percent( gmbrating ) | five( rating )',
ape => 'FMPS_RATING_USER::%i & FMPS_RATING | percent( gmbrating ) | five( rating )',
ilst => '----FMPS_Rating_User::%i & ----FMPS_Rating | percent( ----gmbrating ) | five( ----rating )',
postread=> \&FMPS_rating_postread,
prewrite=> \&FMPS_rating_prewrite,
'postread:five'=> sub { my $v=shift; length $v && $v=~m/^\d+$/ && $v<=5 ? sprintf('%d',$v*20) : undef }, # for reading foobar2000 rating 0..5 ?
...
From what I remember (it's been a while):
So in that case all that should be needed to add writing for 0..5 ratings is to add a prewrite:five function and replace the "|" with "&" (and move, remove or do the same for gmbrating as it's placed before). I guess I didn't do it because I don't know the official definition of this standard and "rating" is such a plain tag that it could be used by other "standards" with a very different idea of what 5 means, so I left it read-only.
playcount should be easy, just add a PLAY_COUNTER lastplay needs to add options to read-write
One thing I'm not sure is how exactly foobar2000 saves its custom tags in the various tag formats, I'm not 100% sure mine will match, so you should test with all 4 types if possible.
So if you are interested I can give you a few more explanations. It will result in a few lines to change to get what you want, but I don't know if I will commit them, if I don't you'd have to keep changing those lines every time you update.
Sure I'm interested! And if You need feedback/testing I can help on that.
Looking at my setup it seems that I'm using a plugin called quicktag. This allows user to set any tag and then bind those to keyboard.
These are the options user is given for auto incrementing playcount:
For tagging fb2k gives options (my version is ancient things might have changed).
Personally I only use ogg and flac formats. so vorbiscomments here! One additonal layer of issues I have is that I used to use this linux player called guayadeque. That supports the tags my foobar2000 makes (dates,counts,ratings), but it changes the ratings from 1,2,3,4,5 to 1,64,128,192,255. On my foobar2000 I have script that shows both of those as 1-5, but it would be better to have one style (the script takes time to load).
I've made a quick patch that should work as you want, though I haven't tested it much, and not at all with any foobar-created custom tags. You have to enable writing in each of the 3 fields options, and restart. You can create shortcuts yourself in the Keys tab using the Set Current Song Rating, rating in gmb is 0-100, so use 0,20,40,60,80 or 100 as arguments (you might want to check the high-priority check box)
https://gist.github.com/squentin/e1aa15027e73d2ec2d438b3b8f32c350
Let me know if you have any problems
Forgot to say, the lastplay is written as UTC/GMT as to me it's more sensible (non-UTC dates are ambiguous) but it can easily be changed.
Nice! I'll play around and let you know if there are any issues.
I am very interested in this topic. Editing track ratings for flac files and saving the value in the file's metadata is the reason I started using GMB (just today). So far it seems to be working better than any other music player I tried.
I'm using GMB version 1.1.16 on Arch Linux. (I tried installing the git version, but it would not run, so I installed the standard package.)
I am still trying to fully understanding the function of editing and saving ratings as metadata in flac files. As I said, so far I like what I see, but I have some questions.
In the command above, @squentin said:
For rating gmb use a value between 0 and 100 or undef for unset
In my testing, it is saving values between 0.0 and 1.0, instead. Do I understand correctly that you convert the internal int values of 0 to 100 to percentages before saving to the file's metadata? If so, why?
Would you consider adding an option to change that behavior so that values of 0-100 are saved? I would actually prefer if the values were in the range 0 to 100 and were integers.
It is saving these values in the FMPS_RATING tag as mentioned above. I did not see it use FMPS_RATING_USER. What determines which of those tag names is used?
You say in your comment above:
You should be able to edit a few lines to achieve what you want, as an example, here is the definitions for the rating field: rating =>
Where can I locate that section of code?
Thanks for your work on this great music player!
I'm running foobar2000 v0.9.5b7 (in wine), recently it's crashing when I add more music to it's library and it seems that there's nothing I can do.
There are few requirements I have though. It's quite ridiculous, but I like to have the tags on my files as I have the same library for few decades now!
The website says that:
Other fields (labels, skip count, ...) can not currently be saved in tags, though it is easy to add, it is mainly a problem of finding standard tags for that.
I have a very solid standard for my tags. How would I enable saving %LAST_PLAYED%, %PLAY_COUNTER%, %RATING% -tags to a file?Then I have a quick tag, so Shift+[1-5] will tag rating. It's really good system, I've been using that for.. (I'm old!)
Is this possible (ofcourse it is), but with reasonably simple changes? I tried making my own audioplayer with python last spring, but the GUI was way too heavy for my liking :P.