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 690219 - [tracker] Allow showing a single file type
[tracker] Allow showing a single file type
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: plugins
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2012-12-14 18:29 UTC by Bastien Nocera
Modified: 2012-12-16 15:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tracker: Add filtering by type (16.88 KB, patch)
2012-12-16 12:50 UTC, Juan A. Suarez Romero
committed Details | Review

Description Bastien Nocera 2012-12-14 18:29:58 UTC
Instead of showing "Videos", "Music", "Photos" containers at the top-level of the Tracker plugin, the Tracker plugin should allow showing a single media type, and do without the sub-containers.

Eg., in Totem, I would only show Videos so:

Tracker -> Music
        -> Photos
        -> Videos -> foo1
                     foo2
                     foo3
would become:
Tracker -> foo1
           foo2
           foo3
Comment 1 Juan A. Suarez Romero 2012-12-14 18:55:57 UTC
Couldn't that be done in the totem-grilo plugin?

I think it could be done by performing a search in Tracker for all the elements, filtering to get only videos.

Adding filtering by media type is something I would need to do, but it could fix the problem.
Comment 2 Juan A. Suarez Romero 2012-12-14 19:01:29 UTC
Just to give more information, the approach I've proposed above is to have a quick fix in Totem.

Actually, what I'm evaluating is that when adding the filtering by type, if developer asks for specific type of content (let's say, all Music and Audio), we would only show at top level Music and Videos, skipping the Photos.

But if developer asks only for one type  (let's say Videos), we could skip the first level and go directly to the second level (show the list of videos).
Comment 3 Juan A. Suarez Romero 2012-12-14 19:02:55 UTC
(In reply to comment #0)

> Tracker -> foo1
>            foo2
>            foo3

And btw, what happens with Music? Shouldn't it be listed too?
Comment 4 Bastien Nocera 2012-12-15 09:48:05 UTC
It *could* be done solely in Totem. The problem isn't about searching though, it's about browsing, and it's a bit of pain having to "re-root" the browse. It also means that we keep a string in Totem that matches against "Videos", which will need to be synced with grilo-plugins when it gains i18n support.

(In reply to comment #3)
> And btw, what happens with Music? Shouldn't it be listed too?

Nope, there's a music app for that (similarly the music and photos apps would have to the same kind of thing)
Comment 5 Juan A. Suarez Romero 2012-12-15 10:04:31 UTC
Probably I'm missing something..... 

The idea would be something like this:

if (source == TRACKER)
  search(source, '*', FILTER_VIDEOS)
else
  browse(source, container)
fi

We wouldn't keep that match against "Videos", as far as I understand, because the with the search ('*') and the filter by  videos it would only return videos.
Comment 6 Bastien Nocera 2012-12-15 11:07:56 UTC
> The problem isn't about searching though,
> it's about browsing

When I filter by type, I get 3 root containers, I don't want any. I just want what's in Videos, and I don't want to special case the Tracker plugin to achieve that.
Comment 7 Juan A. Suarez Romero 2012-12-15 11:11:13 UTC
Yes, and that is what I said in comment #2: if developer filters the content to get just one type of content, let's the filter also automatically skip the first level, so you would get straightly the video contents. This is something I want to implement in the source.
Comment 8 Bastien Nocera 2012-12-15 11:38:25 UTC
Looks like we're violently agreeing then :)
Comment 9 Juan A. Suarez Romero 2012-12-15 11:40:49 UTC
He,  he.

We should use more smiles :)
Comment 10 Juan A. Suarez Romero 2012-12-16 12:50:30 UTC
Created attachment 231642 [details] [review]
tracker: Add filtering by type

Allows to filter content by type (audio, video or images) in both search() and
browse().

Also, if all elements except one is filtered, then browsing root will lead
directly to the elements. This avoids showing just one single element in the
first level.
Comment 11 Bastien Nocera 2012-12-16 15:21:33 UTC
Works for me.
Comment 12 Juan A. Suarez Romero 2012-12-16 15:37:02 UTC
commit 654608dd3bf624b634482e4960462841b0fdebcb
Author: Juan A. Suarez Romero <jasuarez@igalia.com>
Date:   Sun Dec 16 12:47:01 2012 +0000

    tracker: Add filtering by type
    
    Allows to filter content by type (audio, video or images) in both search() and
    browse().
    
    Also, if all elements except one is filtered, then browsing root will lead
    directly to the elements. This avoids showing just one single element in the
    first level.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690219

 src/tracker/grl-tracker-source-api.c |  207 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
 src/tracker/grl-tracker-source-api.h |    3 ++
 src/tracker/grl-tracker-source.c     |    1 +
 3 files changed, 164 insertions(+), 47 deletions(-)


Attachment 231642 [details] pushed as 654608d - tracker: Add filtering by type