After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645523 - Full resolution and tracker plugin
Full resolution and tracker plugin
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal enhancement
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2011-03-22 14:05 UTC by Lionel Landwerlin
Modified: 2011-03-28 16:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the problem (3.32 KB, patch)
2011-03-28 16:17 UTC, Juan A. Suarez Romero
none Details | Review

Description Lionel Landwerlin 2011-03-22 14:05:05 UTC
When using the tracker plugin which now provides metadata and media sources, if you call grl_metadata_source_resolve() or grl_media_source_metadata() function with the full resolution flag, the tracker plugin is going to be called twice and generates twice the same Sparql request under certain circumstances.

Let's say you want metadata for title and album and artist keys for an item and tracker is only able to provide the title key for that given item. Because you asked for full resolution, others metadata sources will be involved in resolving the other keys, including the tracker metadata source which won't give more results than what the tracker media source has been able to deliver.
So the tracker plugin ends up doing twice the same request for no more result.

I understand this is a corner case, but it would be nice to be able to describe such a relation between 2 sources so we don't spend resources doing the same requests several times.
Comment 1 Lionel Landwerlin 2011-03-27 02:52:44 UTC
Apparently the database has been restored a few hours/days back. Juan, can you repost your fix ?

I might have seen an issue.
Comment 2 Juan A. Suarez Romero 2011-03-28 16:17:37 UTC
Created attachment 184477 [details] [review]
Patch to fix the problem

Re-submitting again the patch, as it was lost during a bgo machine failure
Comment 3 Juan A. Suarez Romero 2011-03-28 16:19:01 UTC
Fixed as

commit 5aec4f22278ee32933a8e1faf2db2337e5fed2ca
Author: Juan A. Suarez Romero <jasuarez@igalia.com>
Date:   Thu Mar 24 09:17:49 2011 +0000

    tracker: metadata should not resolve media coming from tracker
    
    This is mainly an optimization: we do not want tracker resolving keys for
    medias coming from tracker.
    
    The rationale is that we have metadata() precisily to do it: invoking resolve()
    after invoking metadata() for Tracker media is useless, as if the key could not
    be resolved with metadata() it will not be resolved with resolve() (both
    functions are sharing the same code).
    
    This fixes https://bugzilla.gnome.org/show_bug.cgi?id=645523
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>

 src/media/tracker/grl-tracker-media.c    |   31 ++++++++++++++++++++++++++++++
 src/media/tracker/grl-tracker-media.h    |    2 +
 src/media/tracker/grl-tracker-metadata.c |    4 +++
 3 files changed, 37 insertions(+), 0 deletions(-)