Skip to content

Instantly share code, notes, and snippets.

@gerardroche
Created October 7, 2014 00:37
Show Gist options
  • Save gerardroche/b3fde344eb4b280b2ac8 to your computer and use it in GitHub Desktop.
Save gerardroche/b3fde344eb4b280b2ac8 to your computer and use it in GitHub Desktop.
Fix Banshee media player db after backup from another system
# backup
mkdir -pv ~/backup/banshee
cp ~/.config/banshee-1/banshee.db ~/backup/banshee/banshee.db
# clear any cache
rm -rfv ~/.cache/banshee-1/
# install sqlite3
sudo apt-get install sqlite3
# open the banshee db
sqlite3 ~/.config/banshee-1/banshee.db
# check for tracks with old paths
sqlite> select TrackID, Uri from CoreTracks WHERE Uri LIKE '%old/path%';
# update with new paths
sqlite> UPDATE CoreTracks SET Uri = replace(Uri, 'old/path/', 'new/path/' );
# might need to update enclosures too
sqlite> UPDATE PodcastEnclosures SET LocalPath = replace(LocalPath, '/old/path/', '/new/path/' );
# check new path on enclosures
sqlite> select ItemID, LocalPath from PodcastEnclosures WHERE LocalPath LIKE '%old/path%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment