How to query with rhythmbox 2.90

Pablo Carranza <[email protected]>
Newsgroups gmane.comp.gnome.apps.rhythmbox.devel
Message-ID <CAD+9R3Q4n8tcHYYUNN_VQip+9VJa9WdwBe=PjS7_tQ91KyHzaA@mail.gmail.com>
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

_______________________________________________
rhythmbox-devel mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/rhythmbox-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.