[Rhythmbox-devel] How to query with rhythmbox 2.90

Hi, i'm trying to adapt my plugin to rhythmbox 2.90.1 and i just cant find a way to query the database, this is as far as I've reached:

import gi
db = shell.props.db
query = gi.repository.GLib.PtrArray()
db.query_append_params(query, RB.RhythmDBQueryType.FUZZY_MATCH, RB.RhythmDBPropType.TITLE_FOLDED, 'a')
sort_func = RB.RhythmDBQueryModel.album_sort_func
model = RB.RhythmDBQueryModel.new(db, query, sort_func, '', False)

And this is what happens:

Traceback (most recent call last):
  File "/usr/lib/rhythmbox/plugins/python-console/pythonconsole.py", line 414, in __run
    exec command in self.namespace
  File "<string>", line 6, in <module>
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 67, in constructor
    return info.invoke(cls, *args, **kwargs)
TypeError: Must be sequence, not PtrArray

The method db.query_append_params expects to get an PtrArray, and if I call db.query_to_string(query)
I get: '(title-folded =~ a)'

Which seems to be ok

In previous versions I've been using db.query_model_new_empty() and db.query_new() which have dissapeared in this rhythmbox version.

What am I doing wrong? How can I query the database?

Pablo Carranza

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]