Re: [Rhythmbox-devel] Question about PROP_LAST_PLAYED and QUERY_PROP_LESS in plugin
- From: Jonathan Matthew <jonathan d14n org>
- To: rhythmbox-devel gnome org
- Subject: Re: [Rhythmbox-devel] Question about PROP_LAST_PLAYED and QUERY_PROP_LESS in plugin
- Date: Thu, 2 Oct 2008 21:31:02 +1000
On Wed, Oct 01, 2008 at 02:01:10PM +0200, eric casteleijn wrote:
> In my ongoing quest to port all of the autoqueue plugin to rhythmbox,
> I've made another small step, by blocking tracks that are played for a
> number of days, but I'm getting strange GLib messages of the form:
>
> GLib-GObject-CRITICAL **: g_value_copy: assertion
> `g_value_type_compatible (G_VALUE_TYPE (src_value), G_VALUE_TYPE
> (dest_value))' failed
This looks like a bug in the rhythmdb python bindings. The value we're
getting out of pygobject is either G_TYPE_INT or G_TYPE_LONG, but the
query expects a G_TYPE_ULONG value for the property you're using.
> every time a time based search is executed, such as:
>
> from time import time
> seconds = track_block_time * 24 * 60 * 60
> now = time()
> cutoff = now - seconds
> search = (
> rhythmdb.QUERY_PROP_LESS, rhythmdb.PROP_LAST_PLAYED, cutoff)
>
> But it does seem to filter correctly. Does anyone know if there is
> anything I'm doing wrong, or are these messages something that I'll have
> to live with?
It's not really wrong to do it that way, but you'd probably be better
off using rhythmdb.QUERY_PROP_NOT_WITHIN instead of
rhythmdb.QUERY_PROP_LESS - this way, the query model will periodically
refresh itself. This won't fix the error messages, but you should only
need to do the query once, which might help a bit.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]