如何从 Banshee 迁移到 Rhythmbox?

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:

  1. 音乐库:只需将您的音乐文件夹指定到 Rhythmbox 即可导入
  2. 播放列表
    • 动态播放列表:据我所知,您必须重新创建它们。不好玩,由于每个玩家的不同功能集而增加了额外的复杂性。
    • 静态播放列表:只需在 Banshee 中将它们导出为 .m3u 并在 Rhythmbox 中重新导入它们
  3. 播放次数和评分
    • 播放次数:我不知道
    • Ratings : 为每个明星创建一个动态播放列表(即创建“rating1,rating2,rating3,rating4,rating5”动态播放列表,然后将它们导出为.m3u,然后将它们导入Rhythmbox。我刚刚测试过,两个播放器都使用文件名相对于 ~ ,所以你会没事的。
    • 两者的一种解决方案是实施#538549 - 使用 ID3v2 人气计进行评分(可能是播放次数)
  4. 广播电台:我不知道
  5. 封面图片:虽然不是“迁移”选项,但 Rhythmbox 2.9x/3在处理封面艺术方面做得更好。通过启用试用Cover ArtCover Art Search插件,Edit / Plugins。在我的情况下(封面艺术在文件夹中存储为 .jpg 或 ID3),它们被识别得很好

希望有帮助!祝你好运 :)


Ger*_*che 5

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)

现在运行脚本,所有播放次数和播放列表都将更新。

故障排除

附录

rhythmbox-banshee-import 脚本
#!/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)