INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Import play statistics from last.fm or iTunes  (Read 1302 times)

Fuzzysocks

  • Recent member
  • *
  • Posts: 6
Import play statistics from last.fm or iTunes
« on: October 20, 2018, 07:52:52 pm »

Hi all,

New JRiver convert here trying to get my audio system setup. I'm moving over from iTunes and would like to copy/import what play statistics are available - in particular, the play count which I find to be useful metadata. I also use last.fm and would be happy to import that data instead. I just want to capture some of the data on what I've listened to in the past. I've been all over the forums and wiki and can't figure it out. Is there a way?

Thanks!
Logged

Fuzzysocks

  • Recent member
  • *
  • Posts: 6
Re: Import play statistics from last.fm or iTunes
« Reply #1 on: November 10, 2018, 01:42:18 pm »

Anyone have any ideas? even just "can't be done"?
Logged

~OHM~

  • Citizen of the Universe
  • *****
  • Posts: 1825
  • "I Don't Play The Music The Music Plays Me"
Re: Import play statistics from last.fm or iTunes
« Reply #2 on: November 10, 2018, 01:47:33 pm »

have you searched this or MC23 threads?...seen alot of talk on this....just don't remember because it never affected me.

good luck
Logged
“I've Reached A Turning Point In My Life. I Now Realize I Have More Yesterdays Then Tomorrows”

Fuzzysocks

  • Recent member
  • *
  • Posts: 6
Re: Import play statistics from last.fm or iTunes
« Reply #3 on: November 10, 2018, 02:41:17 pm »

have you searched this or MC23 threads?

yeah, i've actually spent quite a while trying to figure this out and haven't gotten anywhere. honestly i'm kind of surprised because i would think i'm not the first person to want to do this. thanks though!
Logged

swiv3d

  • Guest
Re: Import play statistics from last.fm or iTunes
« Reply #4 on: November 10, 2018, 05:43:29 pm »

I think, but am not entirely certain, that iTunes keeps its info in an encrypted database which makes it difficult to extract data from. As for last.fm I shouldn't think they would allow extraction of info from their system by any legal means.
Logged

Fuzzysocks

  • Recent member
  • *
  • Posts: 6
Re: Import play statistics from last.fm or iTunes
« Reply #5 on: November 19, 2018, 06:08:50 pm »

As for last.fm I shouldn't think they would allow extraction of info from their system by any legal means.

Thanks for the reply! I know there's a plugin for Foobar2000 that allows you to import the play counts from your last.fm account to Foobar, so at least it's possible. MusicBee didn't have a problem importing play counts from iTunes, so it seems like JRiver should be able to as well.
Logged

swiv3d

  • Guest
Re: Import play statistics from last.fm or iTunes
« Reply #6 on: November 19, 2018, 06:12:02 pm »

Something for the Dev team to look at then! (If they have the time of course!)
Logged

amandalishus

  • Recent member
  • *
  • Posts: 29
  • Experienced MC user masquerading as novice.
Re: Import play statistics from last.fm or iTunes
« Reply #7 on: November 20, 2018, 04:17:05 pm »

[...] iTunes keeps its info in an encrypted database [...]
While it's been a while since I've used iTunes (like, since MC19, I think ;) ), you are only partially correct. While iTunes does access and update data during runtime in a database with a proprietary format (which may or may not be encrypted), it also backs up all the data to a huge XML file in case the proprietary database becomes corrupt. In older versions of iTunes, that file was created or updated each time the application was shut down; however, since iTunes 12.2, it has become necessary to tell it you'd like to create that file. This option is available under iTunes->Preferences->Advanced, where you can check the box labeled "Share iTunes Library XML with other applications". You can then exit the application and the file will be created.

On a Mac, the XML file will be in the Music folder in your user home folder. Unfortunately, I'm not overly familiar with Mac storage anymore since my MacBook died a few years ago, so I can't tell you what the actual file path would be; however, once you find the actual location on the file in the GUI, it shouldn't be too hard to figure out the path.

On a Windows machine, the location of the file varies by Windows version. In Windows 10, it will be in "C:\Users\your username\Music\iTunes". Previous versions of Windows may call the music folder "My Music", or even "My Documents\My Music", but wherever the Music folder is, the iTunes folder will be inside, and the library file will be within it.

Of course, that all assumes a default installation. If you moved your iTunes directory somewhere else using the iTunes option menu then YMMV. However, if you did that then you probably can figure out how to check your configuration to find the specified iTunes folder location, and the library XML file will be within.

Of course, that's only about 1/3 of the problem. The next hurdle is going to be the format of the XML file itself. Apple being Apple, they decided to totally ignore the entire point of XML and store their data as a dictionary of key/value pairs. You can see a sample of the format here (or probably a hundred other places, that just happens to be the one for which I had a link handy. This is a bit of an excerpt here:

   <dict>
      <key>Track ID</key><integer>86</integer>
      <key>Name</key><string>Play Your Part (Pt. 1)</string>
      <key>Artist</key><string>Girl Talk</string>
      <key>Album</key><string>Feed The Animals</string>
         {other data omitted}
      <key>Play Count</key><integer>1</integer>
      <key>Play Date</key><integer>3381673926</integer>
      <key>Play Date UTC</key><date>2011-02-27T21:52:06Z</date>
         {blah blah blah}
   </dict>


So anyway, it shouldn't be very hard to extract the data you want from the file. The hard part (at least as far as I'm concerned) is matching the iTunes data to a track in the JRiver database and then updating the value. Sadly, I haven't played with the JRiver API enough yet to know exactly how difficult that might be. Maybe somebody else can chime in with an answer here, or maybe I can go read some documentation and let you know. I just figured it might be useful to share what I know about the existence and location of the data first, in case someone else already had the third leg of the solution available. If there was, for instance, some kind of command-line method of doing it, then generating those command lines would be reasonably close to trivial.
Logged
[color="#C133FF"][size=18]Documentary aficionado. [/size][size=16]Music lover. [/size][size=14]Software developer. [/size][size=12]Transgender geek. [/size][size=10]Interested in everything. [/size][size=8]Easily distracted...[/size][/color]
Pages: [1]   Go Up