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 748539 - Eliminate duplicates in grl-tracker search results
Eliminate duplicates in grl-tracker search results
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2015-04-27 16:56 UTC by Philip Withnall
Modified: 2015-07-31 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tracker: Eliminate duplicate search results (1.60 KB, patch)
2015-04-27 16:58 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2015-04-27 16:56:43 UTC
If I call grl_source_search() on a grl-tracker source, it can return the same URI in multiple GrlMedias. This can happen if that file is a video with an audio stream — but it will be returned as a GrlMediaVideo multiple times.

If I constrain the result types using
    grl_operation_options_set_type_filter (options, GRL_TYPE_FILTER_VIDEO);
then a single result for each URI is returned, as expected.

Is this intentional? grl-tracker-source-api.c uses DISTINCT in some of its queries (for browse and resolve, but not search) if the browse-filesystem config key is enabled. Why is search different? And what does browse-filesystem semantically have to do with the uniqueness of results?
Comment 1 Philip Withnall 2015-04-27 16:58:00 UTC
Created attachment 302463 [details] [review]
tracker: Eliminate duplicate search results

Add a DISTINCT to the query to eliminate duplicate search results when
using grl_source_browse() on a grl-tracker source. Unlike other uses of
DISTINCT in the source, it is not conditional on the browse-filesystem
config key being enabled.
Comment 2 Bastien Nocera 2015-04-28 09:35:24 UTC
Review of attachment 302463 [details] [review]:

Patch looks good.
Comment 3 Philip Withnall 2015-07-31 10:38:45 UTC
(In reply to Bastien Nocera from comment #2)
> Review of attachment 302463 [details] [review] [review]:
> 
> Patch looks good.

Is that a_c-n?
Comment 4 Bastien Nocera 2015-07-31 10:40:25 UTC
(In reply to Philip Withnall from comment #3)
> (In reply to Bastien Nocera from comment #2)
> > Review of attachment 302463 [details] [review] [review] [review]:
> > 
> > Patch looks good.
> 
> Is that a_c-n?

I was expecting somebody who knows the tracker code better than I do to comment, but I guess that's as good an answer as we'll get for now.

Please commit.
Comment 5 Carlos Garnacho 2015-07-31 11:22:22 UTC
FWIW, this looks correct to me, although the defines are highly generic skeletons of queries, I can't ensure that DISTINCT will be the thing you expect in all the queries that could be constructed with those. Although in the context of grilo, it is likely desirable on almost every situation.
Comment 6 Philip Withnall 2015-07-31 12:26:00 UTC
Thanks for the review.

Attachment 302463 [details] pushed as e1a233d - tracker: Eliminate duplicate search results