Answers:
这是一个已知的错误,已在较新版本的Banshee中修复。
您可以从Banshee PPA使用最新版本的Banshee :
sudo add-apt-repository ppa:banshee-team/ppa
sudo apt-get update && sudo apt-get upgrade
找到sqlite3数据库(〜/ .config / banshee-1 / banshee.db)并运行以下查询:
delete from coretracks where TrackID in
(
select trackid from
(
select TrackID as trackid, count(TrackID) as c from coretracks
group by TitleLowered,ArtistID,AlbumID,Title
)
where c > 1
);
PS使用命令“ sqlite3”打开数据库,而不仅仅是“ sqlite”。
PPS我不得不多次运行查询,每次运行仅删除一个额外的重复项。发生这种情况是因为内部选择只为您返回了每个标题/艺术家/专辑组合的一个多余曲目的ID。
此答案使用python访问banshee数据库,然后执行donbicca列出的sql操作。我不再需要多次运行sql代码,而是让python根据sql代码中存在的实例数循环sql代码。您只需要运行一次此代码。您需要替换主路径(用主路径替换“ / home / JONDOE”)。
#!/usr/bin/env python
import sqlite3
#open database to determine number of rows to loop over
db = sqlite3.connect('/home/me/.config/banshee-1/banshee.db')
cursor = db.cursor()
a = cursor.execute('SELECT TrackID from coretracks group by TitleLowered,ArtistID,AlbumID,Title')
a_trackid = a.fetchall()
db.close()
#Close database to ensure results do not impact future results. Then reopen database
db = sqlite3.connect('/home/me/.config/banshee-1/banshee.db')
cursor = db.cursor()
sql = ('DELETE from coretracks where TrackID in (SELECT TrackID from (SELECT TrackID as trackid, count(TrackID) as g from coretracks group by TitleLowered,ArtistID,AlbumID,Title) where g > 1)')
for i in a_trackid:
cursor.execute(sql)
db.commit()
db.close()
从banshee sqlite数据库中删除duplicqtes歌曲的其他替代方法:
cd /home/youruser/.config/banshee-1/
先关闭女妖!备份数据库:
cp banshee.db banshee.db.bck
如果您没有安装sqlite:
sudo apt-get install sqlite3
打开数据库:
sqlite3 banshee.db
输入以下查询:
DELETE FROM coretracks WHERE TrackID NOT IN (SELECT MIN(TrackID) FROM coretracks GROUP BY TitleLowered, ArtistID,AlbumID,Title);
出口:
.q
完成后,打开Banshee并检查结果。