如何在Rhythmbox中查询数据 [英] How do I query for data in Rhythmbox

查看:117
本文介绍了如何在Rhythmbox中查询数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ubuntu 12.04,并且试图编写一个Python插件来查询Rhythmbox数据库. Rhythmbox版本为v2.96,但v2.97也会出现此问题.当我执行python查询时,Ubuntu崩溃并出现分段错误.

I'm using ubuntu 12.04 and I'm trying to write a python plugin to query the Rhythmbox database. The Rhythmbox version is v2.96 but this issue also occurs with v2.97 as well. When I do a python query, Ubuntu crashes with a segmentation fault.

我需要确认以下内容是正确的,以及是否发现了特定于Ubuntu的错误,或者是否误解了如何正确查询.如果其他使用其他发行版的人可以确认,则非常欢迎.

I need to confirm the following is correct and if I've found a bug specific to Ubuntu or if I've misunderstood how to correctly query. If anyone else using another distro can confirm - this would be most welcome.

我已经在bugzilla上提交了有关细分的错误报告过错.但是,我的问题并不完全是这个问题-它专门试图确认正确的python代码以查询数据.

I've filed a bug report on bugzilla with regards to the segmentation fault. However, my question is not strictly about this - its specifically trying to confirm the correct python code to query for data.

因此,我的问题是:下面的代码段是否正确,可以查询Rhythmbox数据库,还是我需要安装其他软件包才能启用查询.

Thus my question: is the code snippet below correct to query the Rhythmbox database or do I need to install an additional package to enable querying.

步骤:

  1. 启用python控制台插件
  2. 类型(或以下一行一行地复制和粘贴)



from gi.repository import RB, GLib

db = shell.props.db
query_model = RB.RhythmDBQueryModel.new_empty(db)
query = GLib.PtrArray()

db.query_append_params( query, RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ARTIST, 'some artist name' )
db.query_append_params( query, RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.TITLE, 'some song name' )   

db.do_full_query_parsed(query_model, query)

for row in query_model:
    print row[0].get_string( RB.RhythmDBPropType.ARTIST )
    print row[0].get_string( RB.RhythmDBPropType.TITLE )

如果我在输入此行时使用ubuntu 12.04,则Ubuntu会因分段错误而崩溃

If ubuntu 12.04 when I type this line, Ubuntu crashes with a segmentation fault

db.query_append_params( query, RB.RhythmDBQueryType.EQUALS, RB.RhythmDBPropType.ARTIST, 'some artist name' )

因此,我实际上是否正确使用了调用中的第一个参数-查询指针数组(PtrArray)-还是我的查询函数参数不正确?

Thus, have I actually used the first parameter in the call correctly - the Query Pointer Array (PtrArray) - or is my query function parameters incorrect?

推荐答案

,答案是...

嗯,这个问题确实是一个错误-但要回答我自己的问题,

and the answer is...

Well, this issue is indeed a bug - but to answer my own question,

,在问题中正确说明了在Rhythmbox中查询数据的语法.

yes the syntax to query for data in Rhythmbox is as correctly stated in the question.

还有一个...

查询数据仅适用于64位linux.

Querying for data only works for 64bit linux.

是的-我一直在测试Fedora 17和LMDE的32位live-cd.两者都表现出与Ubuntu 12.04相同的分段错误问题.

Yes really - I have been testing 32bit live-cd's of Fedora 17 as well as LMDE. Both exhibit the same segmentation fault issue as Ubuntu 12.04.

共同的因素是,我正在以32位版本测试Ubuntu 12.04/Fedora 17和LMDE.

The common factor is that I was testing Ubuntu 12.04/Fedora 17 and LMDE in their 32bit incarnations.

以其64位变体形式对这三个模块进行测试均符合预期.

Testing all three in their 64bit variants works as expected.

32位问题是一个错误-已在bugzilla上进行了报道-但所提出的问题已得到解决.

The 32bit issue is a bug - and has been reported on bugzilla - but the question as posed has been answered.

谢谢.

这篇关于如何在Rhythmbox中查询数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆