Re: [Rhythmbox-devel] query on PROP_MTIME with limit



On Sat, 2010-06-05 at 08:14 -0400, Jean-Lou Dupont wrote:
> Thanks Matt!
> 
> 
> Somebody on the IRC channel (moch) suggested I might need to include a
> "sort order" on the query.  How would I do that?
> 
> 

My first suggested step would be

grep -nr sort_order *

there's on example in rb-sync-settings-ui.c:269

That said, you won't want that particular sort function, so try a

grep -nr _sort_func *

to see what one you might want to use with a number instead of a title.

> On Fri, Jun 4, 2010 at 9:05 PM, Matt Novenstern
> <mnovenstern students colgate edu> wrote:
>         
>         On Fri, 2010-06-04 at 20:32 -0400, Jean-Lou Dupont wrote:
>         > Hi - I'd like to perform a query on PROP_MTIME with a limit
>         e.g.
>         > retrieve the "X" entries in the database for which
>         PROP_MTIME > t.
>         >
>         >
>         > How would I go about doing this?
>         >
>         
>         
>         I'm not entirely sure if you're using python, but in C you do
>         something
>         like this
>         
>         rhythmdb_do_full_query (pd->priv->db,
>                        RHYTHMDB_QUERY_RESULTS (query),
>                        RHYTHMDB_QUERY_PROP_EQUALS,
>                         RHYTHMDB_PROP_TYPE,
>                         RHYTHMDB_ENTRY_TYPE_PODCAST_POST,
>                        RHYTHMDB_QUERY_END);
>         
>         so, you could do something like
>         
>         rhythmdb_do_full_query ([insert reference to the db],
>                RHYTHMDB_QUERY_RESULTS([your query variable]),
>                RHYTHMDB_QUERY_PROP_GREATER,
>                 RHYTHMDB_PROP_MTIME,
>                 t,
>                RHYTHMDB_QUERY_END);
>         
>         there are lots of examples of the function in
>         rb-podcast-manager.c
>         
Good luck,
 Matt N






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