Filtering by type



Hello.

Some days ago, Iago sent a proposal to have a "filtered" search(), that
would search data that matches a criteria. Thus, we can search by
artist, album, ..., or combinations of them.

The proposal here is not a replacement, but a complement of Iago
proposal. Both would live together.

First of all, let me show you an user case. Lets think I'm implementing
a ImageViewer using Grilo. Of course, I'm only interested in
GrlMediaImage content. So when using browse()/search()/whatever
function, I must filter the content to just get what I'm interested in.

It would be good to have a way of telling Grilo that I'm only interested
in specific content. Doing the filtering myself means that plugins are
doing unneeded work.

Notice that Iago's proposal just focus in the search() operation, while
here we are interested in other operations, like browse().

So the proposal here is to use the GrlMetadatadataResolutionFlags to add
flags about which kind of content the client is interested.

Thus, in the user case exposed above, we can have a GRL_RESOLVE_IMAGE to
just get GrlMediaImages and forget about other results[1].

If we are implementing a audio-video multimedia player, we can user
GRL_RESOLVE_VIDEO | GRL_RESOLVE_AUDIO to get only audios and videos, and
forgetting about photos[1].

>From plugins pov, they can check if user is asking for content that they
can provide; for instance, Jamendo will check if GRL_RESOLVE_AUDIO is in
the flags; if not, then it will invoke the callback() with no results;
else it will perform as usually.

This proposal has the advantage that it doesn't needs a change in the
api: we can use the same api.

I think that I already discussed this proposal with Iago, and he agreed
that we can do it as a first approach.

As usual, comments are welcomed.


	J.A.


[1] Though we would restrict the results to those matching the flags, I
think it is not needed a flag for GrlMediaBox, as it isn't really a
'content' type. Thus, I think GrlMediaBox should always be returned. But
if you think it should also be restricted in with a flag, I don't have a
strong reason against it.



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