GNOME Bugzilla – Bug 715167
Support multiple filesystem sources, one per device
Last modified: 2018-09-24 09:23:55 UTC
It would be nice to be able to present removable media (e.g. USB sticks) as separate top-level GrlSources. To do so, the grl-filesystem plugin would need to support instantiating multiple sources which track the mounted filesystems. This would make the filesystem plugin more closely match, e.g., the UPnP plugin, where each UPnP device is listed as a separate GrlSource.
This feature is implemented in the Tracker plugin. There's an configuration option named "per-device-source" that does precisely that.
OK. Would it make sense to implement it in the filesystem plugin as well?
I think it wouldn't hurt :)
You should be able to do this already by creating new grl-filesystem sources yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses it to show a "Recent" filesystem. Is that enough?
(In reply to comment #4) > You should be able to do this already by creating new grl-filesystem sources > yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses > it to show a "Recent" filesystem. Is that enough? I can see how to set the base URI for the filesystem plugin in the config, but I can’t see how to create multiple instances of GrlFilesystemSource. Even creating it manually with g_object_new(), the chosen_uris have to be set by code with access to GrlFilesystemSourcePrivate. (https://git.gnome.org/browse/grilo-plugins/tree/src/filesystem/grl-filesystem.c#n171) If there is a way to do it, it sounds like a reasonable workaround. Implementing per-device-source in the filesystem plugin itself, though, means that the client doesn’t have to care about filesystem mount monitoring, which is nice.
(In reply to comment #5) > (In reply to comment #4) > > You should be able to do this already by creating new grl-filesystem sources > > yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses > > it to show a "Recent" filesystem. Is that enough? > > I can see how to set the base URI for the filesystem plugin in the config, but > I can’t see how to create multiple instances of GrlFilesystemSource. Even > creating it manually with g_object_new(), the chosen_uris have to be set by > code with access to GrlFilesystemSourcePrivate. https://git.gnome.org/browse/grilo/tree/tools/grilo-test-ui/main.c#n1693 > (https://git.gnome.org/browse/grilo-plugins/tree/src/filesystem/grl-filesystem.c#n171) > > If there is a way to do it, it sounds like a reasonable workaround. > Implementing per-device-source in the filesystem plugin itself, though, means > that the client doesn’t have to care about filesystem mount monitoring, which > is nice. We already have an Optical Media plugin. With some additional patches (in bug 703619) it won't show anything but DVDs or disc images. Not sure that's what you're after.
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > You should be able to do this already by creating new grl-filesystem sources > > > yourself. The grl-filesystem plugin now supports "remote" vfs, and Totem uses > > > it to show a "Recent" filesystem. Is that enough? > > > > I can see how to set the base URI for the filesystem plugin in the config, but > > I can’t see how to create multiple instances of GrlFilesystemSource. Even > > creating it manually with g_object_new(), the chosen_uris have to be set by > > code with access to GrlFilesystemSourcePrivate. > > https://git.gnome.org/browse/grilo/tree/tools/grilo-test-ui/main.c#n1693 Aah, missed that. Thanks! > > (https://git.gnome.org/browse/grilo-plugins/tree/src/filesystem/grl-filesystem.c#n171) > > > > If there is a way to do it, it sounds like a reasonable workaround. > > Implementing per-device-source in the filesystem plugin itself, though, means > > that the client doesn’t have to care about filesystem mount monitoring, which > > is nice. > > We already have an Optical Media plugin. With some additional patches (in bug > 703619) it won't show anything but DVDs or disc images. Not sure that's what > you're after. More after some way of displaying USB sticks separately, so I think the filesystem plugin is more appropriate. It’s quite low priority at the moment though.
As it is implemented right now, if you set several base-uris in the filesystem plugin, it will create one source with those uris as the top-level elements. Not sure if this is what you are suggesting, but we could add a config option so instead of showing one source with all those uris, create one source per each top-level uri. The problem is that it is the application who needs to set up all the base-uris, and once they are set up, they can't be changed during the execution. The other option is to cherry-pick some patches from Optical Media, and create one source per each plugged device.
(In reply to comment #8) > The other option is to cherry-pick some patches from Optical Media, and create > one source per each plugged device. That would make sense, coupled with a ‘per-device-source’ option like in the Tracker plugin. Basically the goal is to display each GrlSource as a different icon in a grid, and to display removable media (USB sticks, CDs, etc.) separately from the main filesystem — as different icons in the grid. So that means having separate sources for removable media, not just one source with several top-level elements. So Bastien’s workaround isn’t quite appropriate for this use case. :-( As I said, this is pretty low priority at the moment, so it’ll be a while until I get a chance to come up with a patch.
Created attachment 310484 [details] [review] TEST: Set per-device-source
(In reply to Philip Withnall from comment #9) > (In reply to comment #8) > > The other option is to cherry-pick some patches from Optical Media, and create > > one source per each plugged device. > > That would make sense, coupled with a ‘per-device-source’ option like in the > Tracker plugin. > > Basically the goal is to display each GrlSource as a different icon in a > grid, and to display removable media (USB sticks, CDs, etc.) separately from > the main filesystem — as different icons in the grid. I don't see how enumerating sources is that much different from enumerating items inside a source, if you know that the source behaves in a particular way. In any case, I wouldn't mind: - making grl-filesystem create one source per configured root - exposing enough information in grl-optical-media for applications to avoid setting up duplicate roots in grl-filesystem > So that means having > separate sources for removable media, not just one source with several > top-level elements. So Bastien’s workaround isn’t quite appropriate for this > use case. :-( Note that I tried to use the per-device-source config option in the tracker plugin in comment 10, but it doesn't create any sources for my films SD card.
Comment on attachment 310484 [details] [review] TEST: Set per-device-source Mark as reviewed so it disappears from the patch review list.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/grilo/issues/34.