Skip to main content

Convert iTunes Playlist to Rhythmbox

Solution: get perl script from http://dwelle.org/eg/transferratingsperl.zip - written by Bowen Dwelle (apparently).  YOU... need to test this if you place any importance on your Rhythmbox setup.  I... do not.  If wreck my playlists and/or library, I'm OK with resyncing the media and starting over.  I don't anticipate any issues/problems, but I did not write the script.

Situation: I have multiple machines at home, each with a different purpose.
MacBook Pro: Music, Pictures, Netflix, etc... Valve/Steam games
IBM T520:  Mostly work type stuff.
iTunes 10.6.3
rhythmbox-0.12.8-1.el6.x86_64

On the Mac I use iTunes to manage my music library, currently around 12,000 songs.  I think it is a very decent solution and meets all of my needs.  On my "PC", I run RHEL 6.3 and Rhythmbox.  (Rhythmbox is the only audio app I have managed to get working using RHEL with the standard repos.)

Issue:  Since my Lenovo is basically just a mirror of my Mac, I don't want to spend a ton of time managing the playlists on that machine, in addition to the Mac.  I was pleased to easily have found a solution that would rewrite the *.xml file for rhythmbox

Here are the EXACT steps, in a very repeatable procedure.
[jradtke@neo ~]$ rsync -urpolvv --size-only --delete morpheus-wlan:/Users/jradtke/Music/iTunes/iTunes\\\ Media/Music/ /home/jradtke/Music/

<!app procedure -- BEGIN
start Rhythmbox
Click Edit | Preferences
Select the Music tab, select "Watch my library for new files"
Let it sort through everything...
Quit Rhythmbox
!app procedure -- END>


[jradtke@neo ~]$ cd
[jradtke@neo ~]$ mkdir Playlist-Conversion
[jradtke@neo ~]$ cd Playlist-Conversion/
[jradtke@neo Playlist-Conversion]$ wget http://dwelle.org/eg/transferratingsperl.zip
--2012-08-11 21:00:54--  http://dwelle.org/eg/transferratingsperl.zip
Resolving dwelle.org... 69.163.200.11
Connecting to dwelle.org|69.163.200.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2934 (2.9K) [application/zip]
Saving to: “transferratingsperl.zip”

100%[============================================================================================================================>] 2,934       --.-K/s   in 0s      

2012-08-11 21:00:55 (260 MB/s) - “transferratingsperl.zip” saved [2934/2934]

[jradtke@neo Playlist-Conversion]$ unzip transferratingsperl.zip
Archive:  transferratingsperl.zip
  inflating: transferratings.pl      
[jradtke@neo Playlist-Conversion]$ scp morpheus-wlan:Music/iTunes/iTunes\\\ Music\\\ Library.xml ./
iTunes Music Library.xml                                                                                                            100%   19MB   1.1MB/s   00:18    
[jradtke@neo Playlist-Conversion]$ find ~ -name rhythmdb.xml
/home/jradtke/.local/share/rhythmbox/rhythmdb.xml
[jradtke@neo Playlist-Conversion]$ ./transferratings.pl ./iTunes\ Music\ Library.xml /home/jradtke/.local/share/rhythmbox/rhythmdb.xml
Parsing iTunes Library...
Parsing Rhythmbox Library...
Backing up Rhythmbox database...
Writing new Rhythmbox database...
[jradtke@neo Playlist-Conversion]$ grep \>Rating\< iTunes\ Music\ Library.xml  | egrep '80|100' | wc -l
446

[jradtke@neo Playlist-Conversion]$ rpm -qa | grep ^rhythmbox
rhythmbox-0.12.8-1.el6.x86_64

If you now start up Rhythmbox and look at "My Top Rated" playlist, you should see 446 files.

NOTES:
I will update this post if I discover any issues.  The one thing that impresses me is how well it works without modification.  In particular, the following:
on my Mac the path to my Music is the ridiculous path
/Users/jradtke/Music/iTunes/iTunes Media/Music
whereas, the path on my RHEL host is
/home/jradtke/Music 



Comments

  1. Do I need the iTunes Music Library.xml file to do this?

    ReplyDelete
    Replies
    1. Yes - You will need your iTunes Music Library.xml

      I'm actually pretty horrible at writing these things (I just discovered).
      The newer versions of iTunes do some nonsense with Album Ratings, etc... which pretty much render this process useless.
      I posted a newer entry (which I will update when I am home with the name of the AppleScript)
      http://unixrevolution.blogspot.com/2016/08/convert-itunes-to-rhythmbox-2016.html

      Delete
    2. When I get to my notebook running Mac OS X 10.6.8, I'll copy it to my Linux machine.
      Thank you.

      Delete

Post a Comment

Popular posts from this blog

P2V using dd for KVM-QEMU guest

Preface: I have certainly not exhaustively tested this process.  I had a specific need and found a specific solution that worked. Situation:  I was issued a shiny new laptop running Red Hat Enterprise Linux 7 (with Corp VPN, certs, Authentication configuration, etc...)  The image was great, but I needed more flexibility on my bare metal.  So, my goal was to P2V the corporate image so I could just run it as a VM. * Remove corporate drive and install new SSD * install corp drive in external USB-3 case * Install RHEL 7 on new SSD * dd old drive to a disk-image file in a temp location which will be an image which is the same size as your actual drive (unless you have enough space in your destination to contain a temp and converted image) * convert the raw disk-image to a qcow file while pushing it to the final location - this step should reduce the disk size - however, I believe it will only reduce/collapse zero-byte blocks (not just free space - i.e. if you de...

Sun USS 7100 foo

TIP: put ALL of your LUNs into a designated TARGET and INITIATOR group when you create them.  If you leave them in the "default" group, then everything that does an discovery against the array will find them :-( I'm struggling to recognize a reason that a default should even be present on the array. Also - who, exactly, is Sun trying to kid.  The USS is simply a box.. running Solaris .. with IPMP and ZFS.  Great.  If you have ever attempted to "break-in" or "p0wn" your IBM HMC, you know that there are people out there that can harden a box - then.. there's Sun.  After a recent meltdown at the office I had to get quite intimate with my USS 7110 and learned quite a bit.  Namely: there's a shell ;-) My current irritation is how they attempt to "warn you" away from using the shell (my coverage expired a long time ago to worry about that) and then how they try to hide things, poorly. I was curious as to what version of SunOS it ...

"Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)"

"Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)" One issue that may cause this to arise is if you managed to break your /etc/fstab We had an engineer add a line with the intended options of "nfsvers=3" but instead added "-onfsvers=3" and it broke the system fairly catastrophically.