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...

Extending SNMP to run arbitrary shell script

Why are we here... This is not likely something I would have pursued under normal circumstances.  I happen to be working for a customer/client who is not afforded a lot of flexibility to accomplish their goals.  In this case, the rigor is justified.  They have to sometimes be fairly creative with how they solve problems. In this case they would like to utilize an existing snmp implementation to execute a command (or shell script) on a remote system.  They came to me with the idea of using Net-SNMP extend. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sect-System_Monitoring_Tools-Net-SNMP-Extending.html NOTE:  This is NOT a good implementation strategy in the "real world"  it will simply allow you to test the functionality.  There are a TON of security implications which would need to be taken in to consideration. Implementation Steps: [root@rh7tst01 ~]# yum -y install net-snmp net-snmp-utils ...

RHN Satellite Server (spacewalk) repomd.xml not found

"repomd.xml not found" If you add a channel, or if your RHN cache gets corrupted, and one of your guests complains that it cannot find repomd.xml for jb-ews-2-x86_64-server-5-rpm (for example) - you need to rebuild your repodata cache. Normally this is an automated job - which is exemplified by the fact that you have obviously built out your entire Satellite environment and never had to do any of the steps you are about to do. So - some prep work: Open 3 terminals to your Satellite Server and run: # Term 1 cd /var/cache/rhn watch "ls -l | wc -l" # Term 2 pwd cd /var/log/rhn tail -f rhn_taskomatic_daemon.log # Term 3 satellite-sync --channel=jb-ews-2-x86_64-server-5-rpm Once the satellite-sync has completed, you >should< see the count increment by one.  If you are unlucky (like me) you will not. You then need to login to the Satellite WebUI as the satellite admin user. Click on the Admin tab (at the top) Task Schedules (on the left) fin...