Re: [Rhythmbox-devel] RB python plugin db sort by track number
- From: Pablo Carranza <pcarranza gmail com>
- To: ikwyl6 gmail com
- Cc: rhythmbox-devel gnome org
- Subject: Re: [Rhythmbox-devel] RB python plugin db sort by track number
- Date: Tue, 22 Feb 2011 09:45:34 +0100
Sample snippet putting it all together:
-----------------------------------
query = db.query_new()
query_model = db.query_model_new(query, rhythmdb.rhythmdb_query_model_track_sort_func, 0, db.query_model_new_empty())
db.query_append(query, [rhythmdb.QUERY_PROP_EQUALS, rhythmdb.PROP_ALBUM, self.album]) # Your code
db.do_full_query_parsed(query_model, query)
-----------------------------------
This will fill the query model, which will be sorted with the provided function, with your query.
Cheers
On Tue, Feb 22, 2011 at 3:04 AM,
<ikwyl6 gmail com> wrote:
For my plugin, the query below returns all songs that has the same album as self.album. I looked through your source but I'm not familiar with python's formatting for query options. Do you know how I would incorporate my query of getting the album using this line:
db.query_append(q, [rhythmdb.QUERY_PROP_EQUALS, rhythmdb.PROP_ALBUM, self.album])
to have it sorted? Do I append the rhythmdb.rhythmdb_query_model_track_sort_func portion into the line above? If so, how do I do it? I can't find any documentation on any of these python functions for rhythmbox.
Thanks for any help,
On Sun, Feb 13, 2011 at 2:47 PM, Pablo Carranza
<pcarranza gmail com> wrote:
Hi there,
Sample:
import rb, rhythmdb
query_model = db.query_model_new(db.query_new(), rhythmdb.rhythmdb_query_model_track_sort_func, 0, db.query_model_new_empty())
Cheers!
Hi,
I'm pretty new to python and I find it hard to find any documentation on the rhtyhmbox python API. Using code from other plugins I have a working plugin but I would like the results to be sorted by track number. Can someone maybe have a quick look at:
and let me know how I can use this code to get the results of an album, sorted by track number?
Thanks,
_______________________________________________
rhythmbox-devel mailing list
rhythmbox-devel gnome org
http://mail.gnome.org/mailman/listinfo/rhythmbox-devel
--
Pablo Carranza
--
Pablo Carranza
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]