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 679624 - grl-optical-media reports USB sticks as DVD
grl-optical-media reports USB sticks as DVD
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-07-09 12:06 UTC by Mathias Hasselmann (IRC: tbf)
Modified: 2013-04-04 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (3.69 KB, text/plain)
2012-07-09 12:08 UTC, Mathias Hasselmann (IRC: tbf)
  Details
optical-media: Don't show USB drives in the list (1.35 KB, patch)
2013-03-29 17:08 UTC, Bastien Nocera
committed Details | Review

Description Mathias Hasselmann (IRC: tbf) 2012-07-09 12:06:30 UTC
grilo commit c9121c2445462ddbe63516f69154fcb96f79c7a1
grilo-plugins 3f514cb7b6ee6b02f10dfebe86574e673302ac6f

libtotem-plparser17 3.4.1-1 (Ubuntu)
Comment 1 Bastien Nocera 2012-07-09 12:07:57 UTC
what does test-parser on the USB stick's root mount report? What URL do you get back?
Comment 2 Mathias Hasselmann (IRC: tbf) 2012-07-09 12:08:43 UTC
Created attachment 218328 [details]
test case
Comment 3 Mathias Hasselmann (IRC: tbf) 2012-07-09 12:09:18 UTC
(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)
Comment 4 Mathias Hasselmann (IRC: tbf) 2012-07-09 12:10:14 UTC
ah. it reports with file URL. hmm. why does it report at all? checking.
Comment 5 Bastien Nocera 2012-07-09 12:27:34 UTC
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   }•
Comment 6 Mathias Hasselmann (IRC: tbf) 2012-07-10 06:58:44 UTC
(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".
Comment 7 Bastien Nocera 2012-07-10 09:50:57 UTC
(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.
Comment 8 Bastien Nocera 2013-03-29 17:08:32 UTC
Created attachment 240133 [details] [review]
optical-media: Don't show USB drives in the list
Comment 9 Juan A. Suarez Romero 2013-04-04 14:18:33 UTC
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