GNOME Bugzilla – Bug 690219
[tracker] Allow showing a single file type
Last modified: 2012-12-16 15:37:05 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
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.
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).
(In reply to comment #0) > Tracker -> foo1 > foo2 > foo3 And btw, what happens with Music? Shouldn't it be listed too?
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)
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.
> 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.
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.
Looks like we're violently agreeing then :)
He, he. We should use more smiles :)
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.
Works for me.
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