Raf*_*lak 14 music migration banshee rhythmbox
正如已经决定的那样,Ubuntu Precise 12.04 将以Rhythmbox作为默认音乐播放器。我知道,这并不意味着我将无法使用 Banshee,不过我想切换到它。
我长期以来一直是 Rhythmbox 的粉丝,但是在Natty切换到 Banshee 之后,我决定尝试一下并完全迁移到它。但是,我对它不是很满意,它对我来说滞后很多并且还有一些其他问题。
我想将所有 Banshee 数据导出到 Rhythmbox。包括了:
我应该怎么做才能将所有这些数据移动到 Rhythmbox,让它作为默认音乐播放器工作,并顺利完全切换到它?
Ron*_*het 13
我的两分钱,适用于 Banshee 2.3.3 / Rhythmbox 2.95:
Cover Art和Cover Art Search插件,Edit / Plugins。在我的情况下(封面艺术在文件夹中存储为 .jpg 或 ID3),它们被识别得很好希望有帮助!祝你好运 :)
该Rhythmbox音乐播放器-女妖-导入脚本将迁移播放次数和收视率。感谢@xiphosurus。但是,要使脚本正常工作,您需要告诉它 banshee 和 rhythmbox 数据库的位置。
找到您的 rhythmbox 和 banshee db 文件。默认位置将是:
/home/YOUR_USERNAME/.local/share/rhythmbox/rhythmdb.xml
/home/YOUR_USERNAME/.config/banshee-1/banshee.db
Run Code Online (Sandbox Code Playgroud)
支持他们!我再说一遍。做好备份。
现在将 banshee.db 文件复制到 rhythmbox-banshee-import 脚本所在的文件夹中。然后修改 rhythmbox-banshee-import 脚本,其中 line 说:
RB_DB = 'rhythmdb.xml'
Run Code Online (Sandbox Code Playgroud)
插入 path/to/your/rhythmboxdb.xml 文件,例如:
RB_DB = '/home/YOUR_USERNAME/.local/share/rhythmbox/rhythmdb.xml'
Run Code Online (Sandbox Code Playgroud)
现在运行脚本,所有播放次数和播放列表都将更新。
没有名为 lxml 的模块
如果出现错误... ImportError: No module named lxml ...,则需要安装 Python Xml Parsers:
sudo apt-get install python-lxml
Run Code Online (Sandbox Code Playgroud)没有权限
如果您收到“权限被拒绝”,那可能是因为您没有足够的权限来访问其他用户目录中的文件,或者是因为该文件不可执行。要使其可执行,请运行:
chmod +x /path/to/your/rhythmbox-banshee-import-script
Run Code Online (Sandbox Code Playgroud)#!/usr/bin/python
"""
Copyright (c) 2009 Wolfgang Steitz
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
"""
import sys
import sqlite3
from lxml import etree
RB_DB = 'rhythmdb.xml'
BA_DB = 'banshee.db'
class banshee_db():
def __init__(self, file):
self.con = sqlite3.connect(file)
def get_song_info(self, url):
try:
res = self.con.execute('select Rating, Playcount from CoreTracks where uri = ?', (url,) ).fetchone()
if res is None:
return None, None
else:
return res
except:
return None, None
banshee = banshee_db(BA_DB)
tree = etree.parse(RB_DB)
root = tree.getroot()
for song in root:
if song.get("type") == 'song':
rating = None
playcount = None
for attr in song:
if attr.tag == 'location':
location = attr.text
if attr.tag == 'rating':
rating = attr.text
if attr.tag == 'play-count':
playcount = int(attr.text)
song.remove(attr)
rating_banshee, playcount_banshee = banshee.get_song_info(location)
if rating is None:# noch kein rating in db
if not (rating_banshee == 0 or rating_banshee is None):
rating = rating_banshee
if not (playcount_banshee == 0 or playcount_banshee is None):
if playcount is None:
playcount = playcount_banshee
else:
playcount += playcount_banshee
#insert rating into rb db
if rating is not None:
element = etree.Element('rating')
element.text = str(rating)
song.append( element)
#update playcount
if playcount is not None:
element = etree.Element('play-count')
element.text = str(playcount)
song.append( element)
tree.write(RB_DB)
Run Code Online (Sandbox Code Playgroud)