Possible to Assign Track Ratings in Bulk?
#16
Ah, cross posted, I'll have a look at the example see what we have in the tags.

No rating value of any kind, right? Ah rating as text "FIVE" in comment
Reply
#17
This is what I get dumping the tags

Code:
Title:  Good Vibrations: Thirty Years of the Beach Boys        Released 1993  m4a TAG data retrieved at Sat Oct 22 16:48:35 2016

    [(18, 29)]. Our Prayer

        ©alb: [u'Good Vibrations: Thirty Years of the Beach Boys']
        ----:com.apple.iTunes:UFIDhttp://www.cddb.com/id3/taginfo1.html: ['3CD3N20R16848570U128BC38E26483820E4130A8F1D21D8B9D71P5']
        tmpo: [140]
        ©ART: [u'The Beach Boys']
        ----:com.apple.iTunes:iTunes_CDDB_IDs: ['29++']
        trkn: [(18, 29)]
        aART: [u'The Beach Boys']
        ©too: [u'iTunes 12.3.3.17']
        cpil: False
        ©cmt: [u'Five']
        ©nam: [u'Our Prayer']
        soal: [u'Good Vibrations: Thirty Years of the Beach Boys']
        ©day: [u'1993']
        pgap: False
        ©gen: [u'Pop']
        disk: [(2, 4)]
        ----:com.apple.iTunes:Encoding Params: ['vers\x00\x00\x00\x01acbf\x00\x00\x00\x03vbrq\x00\x00\x00\x00']
        ----:com.apple.iTunes:iTunNORM: [' 00000216 00000233 00000E59 00000F2E 000003A0 000003A0 00004920 00004B25 000003CE 000003CE']

Sadly, I don't see a ratings tag, but happy to be corrected !!
Learning Linux the hard way !!
Reply
#18
It you add tags in Mp3tag, say called RATING, then it creates a tag called "----:com.apple.iTunes:RATING"

Kodi could be changed to read a tag named that way, but we need to agree a standard for the value range too. POPM is stored as 0-255, so this is not as obvious as you might think. And them we need to convince my fellow team members that we are not just going off on one Smile

But this route still leaves you getting your iTunes rating into this tag somehow.
Reply
#19
(2016-10-22, 17:40)DaveBlake Wrote: Ah rating as text "FIVE" in comment

That's not an iTunes rating. I assume Jasn added that to export per an earlier post.
Reply
#20
FYI, I added the "Five" in the comments section manually. I do that to all of my songs out of fear my iTunes Music Library.xml file is lost to a system crash and all of my ratings would be lost.

[Ha! WP and I are in lock step!]
Reply
#21
Quote:One route forward would be for us to agree on a mp4 tag name for the rating values, and providing you can get Mp4tag to write it and Taglib (the library of tools Kodi uses to raed tags) to read it then Kodi could process it. You tell me you are storing rating in mp4 with Mp3tag or dbPoweramp, but not where. How about letting me have some small example files so I can see what you have done. Does any other player handle iTunes ratings somehow?

Love that idea for my own purposes but recognize that it may not be best over the long run. Besides, a websearch will show you that ratings format differ based on tagging software (mp3tag and dbPA) and media players.

Happy to provide a ALAC/dbPA file tagged for Rating but running out for now. Will be back... Smile
Reply
#22
Backup the iTunes xml maybe?

I actually think an addon that sets the rating for a bunch of songs would be the better solution than anything I can do with tags.
Reply
#23
Maybe a stupid suggestion, but in the meantime if Kodi can read the comment tag of a .m4a file then couldn't someone with sql ability write a quick command to copy the contents of the comment field to the userrating field in the music database, so Jasn and other heavy .m4a users could open the database with an sql editor and run that command to populate Kodi. That would save having to manually rate every track.

Don't try this at home - but something like this?

Update 'song' SET userrating=comment
Reply
#24
(2016-10-22, 18:19)DaveBlake Wrote: Backup the iTunes xml maybe?

I actually think an addon that sets the rating for a bunch of songs would be the better solution than anything I can do with tags.

I agree. If I had the skills I'd do it myself.
Reply
#25
(2016-10-22, 18:19)WelshPaul Wrote: Maybe a stupid suggestion, but in the meantime if Kodi can read the comment tag of a .m4a file then couldn't someone with sql ability write a quick command to copy the contents of the comment field to the userrating field in the music database, so Jasn and other heavy .m4a users could open the database with an sql editor and run that command to populate Kodi. That would save having to manually rate every track.
If the comment field contained a numeric, e.g. "5", not "FIVE" then this is very easy

Code:
UPDATE song SET userrating = comment

But I also presume comment fields will not be just a number, so you could want a where clause on that too.

A series of edits would work too, like this
Code:
UPDATE song SET userrating = 1 WHERE comment LIKE "ONE";
UPDATE song SET userrating = 2 WHERE comment LIKE "TWO";
...
UPDATE song SET userrating = 5 WHERE comment LIKE "FIVE"

This is in v17 of course Smile
Rating is an integer 0 to 10, so maybe you do some range converstion too
Code:
UPDATE song SET userrating = 10 WHERE comment LIKE "FIVE"

You can be a lot more creative with the where clauses too, let me know what you are trying to do.
Reply
#26
Holy crap - my first SQL attempt was the same as Dave's with no cheating. That's like scoring the winner for Liverpool against Man Utd.
Reply
#27
Good for you, just take a copy of MyMusic60.db before you start just in case of accidents.
Reply
#28
Whoa... lot's to digest here for me, and would appreciate some help if possible.

The comment field in iTunes can be an integer, not just text, so that makes the simple code feasible.

Code:
UPDATE song SET userrating = comment

That's great, and would make life very easy to convert the comment field to userrating field. Two other potential, personal complications...

Dave, would this also work on for v16? (MyMusic56.db) [EDIT] I will UG to v17 if it makes this translation possible.

I am completely uneducated about running SQL commands. I've DL'd a program (Universal SQL Editor) and opened the file but nothing is obvious to me. I can't even find the term userrating in the opened file. Any suggestions as to how & where I start educating myself on making this happen?

Thx.
Reply
#29
In version 16 there's no user rating field, so if you want to stick with that version just use 'rating' instead of 'userrating'.

I don't know Universal SQL Editor but I imagine most packages are similar. I use DB Browser so can explain for that. As Dave said please do take a copy of your Music DB before doing anything so you can put it back if this goes wrong, Open your database (in your userdata/database folder) in DB Browser. Go to the Browse Data tab to take a look at your various sheets, the one we're interested in is Song, which you can choose from the dropdown box. Check that it's got all your comment values in as you'd expect and there's nothing in the rating column. All you now have to do is go to the Execute SQL tab at the end and in the box type the command:

Code:
Update 'song' SET userrating=comment
for Krypton v17 or
Code:
Update 'song' SET rating=comment
for Jarvis v16

If you haven't already converted your comment to numbers you'll need to add the commands Dave added in his post.

Click the play symbol to run the command and go back to the Browse Data tab to check the rating column has updated. If all looks good then choose write changes at the top of the page and re-open Kodi and hopefully your ratings will be there.
Reply
#30
Thanks very much for the advice WP. I'll give this a try and report back.

~jasn
Reply

Logout Mark Read Team Forum Stats Members Help
Possible to Assign Track Ratings in Bulk?0