Removing duplicate tracks from Banshee

Despite my existential angst that all modern music applications created since Winamp 2.8 suck, I have to play my music with something, so I’ve been using Banshee because it’s Good Enough. But I put up with crap, like, recently I noticed that there were dozens of duplicate tracks listed in banshee’s database. So if I queued up an album, I’d get songs repeated occasionally. Very annoying. There are other people out there with the same problem, but the only listed solution is an out-of-date plugin.

Luckily Banshee’s database is an open sqlite database ((I can’t even find a link to a description of the iTunes library format)), so I poked around a bit (the database is in ~/.config/banshee-1/). Sure enough, I found duplicate entries in the CoreTracks table. Interestingly, though, there’s another table called Tracks that didn’t have the duplicated entries. And the tables are related!

So this is the command I used:
DELETE FROM CoreTracks WHERE CoreTracks.TrackID NOT IN (SELECT TrackID FROM Tracks);

This solved my duplicate tracks problem. As always when messing around with databases and the “DELETE” command, use extreme caution. I recommend a little gentle testing with SELECT commands first before you do anything stupid. Or, smarter still, back up your database first.

3 thoughts on “Removing duplicate tracks from Banshee”

  1. Like the article so I installed SQLite Database Browser v. 1.35 and opened the banshee.db from Banshee 1.61. I could not find the Tracks table in the structure. CoreTracks was quickly located but Tracks appears to have been eliminated. What version of Banshee did you do this with?

  2. Like Martin, I haven't the Tracks table and I've not found anything similar.
    The same happens on Banshee 1.8.0 and Banshee 1.9.0 (from Ubuntu ppa).

Comments are closed.