GNOME Bugzilla – Bug 679624
grl-optical-media reports USB sticks as DVD
Last modified: 2013-04-04 14:18:39 UTC
grilo commit c9121c2445462ddbe63516f69154fcb96f79c7a1 grilo-plugins 3f514cb7b6ee6b02f10dfebe86574e673302ac6f libtotem-plparser17 3.4.1-1 (Ubuntu)
what does test-parser on the USB stick's root mount report? What URL do you get back?
Created attachment 218328 [details] test case
(In reply to comment #1) > what does test-parser on the USB stick's root mount report? What URL do you get > back? browse_cb(grl-optical-media): opid=2, remaining=-1, media="LHUSB" GrlMediaVideo(id=file:///dev/sdb, mime-type=x-special/device-block, url=file:///media/LHUSB)
ah. it reports with file URL. hmm. why does it report at all? checking.
The device "can eject" and "has media". We don't have any other way to differentiate it from an actual optical drive with a DVD inserted. 356 if (g_drive_can_eject (drive) == FALSE ||• 357 g_drive_has_media (drive) == FALSE) {• 358 return media_list;• 359 }•
(In reply to comment #5) > The device "can eject" and "has media". We don't have any other way to > differentiate it from an actual optical drive with a DVD inserted. You can check for folders like VIDEO_TS and AUDIO_TS. Also g_drive_get_name() talks about a DVD drive, so at list GIO seems to get all relevant information. As a crude hack one could check the string returned for g_icon_to_string (g_drive_get_icon (drive)), it should read something like ". GThemedIcon drive-optical drive".
(In reply to comment #6) > (In reply to comment #5) > > The device "can eject" and "has media". We don't have any other way to > > differentiate it from an actual optical drive with a DVD inserted. > > You can check for folders like VIDEO_TS and AUDIO_TS. Except that totem-pl-parser already does that, and properly, not in a hard-coded-can't-be-extended way. If we want to do things badly, it would be easier. > Also g_drive_get_name() talks about a DVD drive, so at list GIO seems to get > all relevant information. The drive name comes from the disk/mount monitor. The way it computes the name is backend-specific. In the case of the udisks2 backend, it gets it from udisks itself, so we have no visibility on the decision. > As a crude hack one could check the string returned for g_icon_to_string > (g_drive_get_icon (drive)), it should read something like ". GThemedIcon > drive-optical drive". That's probably, and unfortunately, the best way.
Created attachment 240133 [details] [review] optical-media: Don't show USB drives in the list
commit 28bb41fea5146f14139194d4f210eb7351cf2981 Author: Bastien Nocera <hadess@hadess.net> Date: Fri Mar 29 17:58:58 2013 +0100 optical-media: Don't show USB drives in the list https://bugzilla.gnome.org/show_bug.cgi?id=679624 src/optical-media/grl-optical-media.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) Attachment 240133 [details] pushed as 28bb41f - optical-media: Don't show USB drives in the list