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

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

Install RHEL 7 on old HP DL380 g5

Someone at work had been running RHEL on an HP DL380 G5 and blew it up.  After several attempts at doing an installation that made me conclude the hardware was actually bad... I kept digging for the answer. Attempt install and Anaconda could not find any disks - try a Drivers Disk (dd.img) both cciss and hpsa.   -- once we did that, when the system would reboot it would say it could not find a disk. hmmm. Boot from your installation media and interrupt the startup at grub. Add hpsa.hpsa_allow_any=1 hpsa.hpsa_simple_mode=1 to the line starting with linuxefi press CTRL-X to boot. Once the system restarts after the install, you need to once again interrupt the startup and add the line from above. After the system starts, edit /etc/default/grub and add those 2 parameters to the end of the line starting with GRUB_CMDLINE_LINUX (which likely has quiet at the end of the line currently). then run # cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig # grub2-mkconfig -o /boot/grub2

MOTD with colors! (also applies to shell profiles)

I'm not sure why I had never looked into this before, but this evening I became obsessed with discovering how to present different colored text in the /etc/motd. A person had suggested creating a shell script (rather than using special editing modes in vi, or something) and I agree that is the simplest way of getting this accomplished quickly. This most noteworthy portion of this script is the following: RESET="\033[0m" that puts the users shell back to the original color. I typically like a green text on black background. Also - a great reference for the different colors and font-type (underscore, etc...) https://wiki.archlinux.org/index.php/Color_Bash_Prompt I found this example on the web and I wish I could recall where so that I could provide credit to that person. #!/bin/bash #define the filename to use as output motd="/etc/motd" # Collect useful information about your system # $USER is automatically defined HOSTNAME=`uname -n` KERNEL=`un