Rhythmbox to banshee

Having just upgraded to the latest Ubuntu I figured I’d try the new music player. Unfortunately when I tried to import all the music on my laptop over to it all I got as ‘Unable to import song’.

Much faffing later I figured out that it was down to the extensions of the music files. Or rather the lack of them. I’m not entirely sure why don’t have extensions, perhaps because I dragged them over from a daapd server, but the lack of a file extension seems to have been the cause of the problem.

To fix the problem I first created a simple shell script to fix the extension of a single file. It’s very crude, it will rename any file to either .aac or .mp3, even non music files so you need to make sure you only use it on music files.

#!/bin/sh

if file "$1" | grep -q AAC
then
    mv "$1" "$1.aac"
else
    mv "$1" "$1.mp3"
fi

Then I simply used find to execute the script against every file in the Music directory.

find Music -type f  -not -name "*.mp3" -not -name "*.aac" -exec ~/fix_extension.sh {} \;

Note that I’m assuming only mp3 and aac extensions in the directory. If you have others in your music directory make sure they don’t come up in the file command’s run. Test the file command without without the -exec to see what files are matched.

Once you’ve done that you should be able to import the Music folder again and hopefully this time the missing files should import without incident.

This should be a temporary problem. There should be a fix upcoming for banshee to fix this issue.

About these ads
Tagged

2 thoughts on “Rhythmbox to banshee

  1. James Hamilton says:

    I cannot thank you enough for this mini-tutorial! It’s solved all my problems with Banshee not finding my whole Music library!

  2. colinnewell says:

    Thanks, I’m glad I could help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 58 other followers