Re: Adding filtering API



On 20/01/2011 10:14, Juan A. Suárez Romero wrote:
> The idea is to provide a:
>
> guint
> grl_media_source_search_pattern(GrlMediaSource *source,
>                                 GrlMedia *pattern,
>                                 guint skip,
>                                 guint count,
>                                 GrlMetadataResolutionFlags flags,
>                                 GrlMediaSourceResultCb callback,
>                                 gpointer user_data);
> as it can be seen, the signature is the same as in search(), but
> replacing the "text" by "pattern".
>
> What is pattern? It's a GrlMedia that client builds and fills with the
> restrictions we wants. Plugin will provide all medias that matches with
> that pattern.
I like that idea. We'll see if we need more filtering in the future, but
I'd tend to think that clients needing finer filtering will probably
have to implement it post-search (especially since most back-ends won't
be able to provide filtering that goes beyond that)
> For instance, if client wants all songs with artist 'Madonna' and album
> 'Ray of Light', she would create a pattern as:
>
> GrlMedia *pattern = grl_media_audio_new();
> grl_media_audio_set_artist (pattern, "Madonna");
> grl_media_audio_set_album (pattern, "Ray of Light");
>
> And invoke grl_media_source_search_pattern(). Plugin will return all
> GrlMediaAudio where artist and album are the same as in the pattern.
>
> The advantage is that for plugins it is more easier to parse properties
> and values than using an expresion like "artist = 'Madonna' AND album =
> 'Ray of Light'"
>
> 	J.A.
>
>
> _______________________________________________
> grilo-list mailing list
> grilo-list gnome org
> http://mail.gnome.org/mailman/listinfo/grilo-list
>



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