About resolve() operation in sources that do not support it
- From: "Juan A. Suarez Romero" <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: About resolve() operation in sources that do not support it
- Date: Fri, 19 Oct 2012 14:23:29 +0200
Hello.
I would like to comment here about a problem I found recently with the
support of some operations in the sources.
Everytime we want to execute an operation in a source GrlFoo, the API
fails (with g_value_return_if_fail()) if the source does not support
that operation.
So we need to check with grl_source_supported_operations() if the source
support that operation.
Now let's think in this use case: I have a source GrlFoo that only
supports browse(), and that provides audio content, but not the
thumbnail value.
So let's suppose that we have an application that when browsing the
content, it only requests the title, and then it uses a resolve() to get
the thumbnail for each selected element.
What is the problem? Basically, when if I try to invoke the resolve
operation to request the thumbnail, telling Grilo that should search in
all plugins, operation will fail. Reason is that GrlFoo does not support
the resolve(), so developer can not invoke it in that source. Rather, he
must search for a plugin that supports the resolve (ideally, the same
source that supports the thumbnail key) and perform the operation there.
A similar problem happens when updating metadata; if I get an element
from Jamendo and want to set the rating and that value, basically I need
to search who supports the rating key and the store_metadata()
operation, and then perform the operation in that source; we can't
perform it with Jamendo because Jamendo doesn't implement
store_metadata().
What's the summary? The idea is that both resolve() and store_metadata()
shouldn't check if the source supports that operation. Rather, if the
user set the FULL_RESOLVE or WRITE_FULL flags, the core should
automatically search who can resolve/store the requested keys, and reply
accordingly. If no source can't attend the request, or the user didn't
ask for FULL resolve/store, then the operation would perform as if the
source really implemented it, but failed.
So if developer performs resolve(GrlFoo, my_media, [keys]) it will work
even if GrlFoo doesn't implement resolve.
I'll do the proper changes in core (doesn't affect the API at all) to
solve this problem.
J.A.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]