Bug 627516 - Support Kindle as an ebook reader, not an mp3 player
Support Kindle as an ebook reader, not an mp3 player
Status: NEW
Product: gvfs
Classification: Core
Component: gdu volume monitor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
:
Depends on: 720938
Blocks:
  Show dependency tree
 
Reported: 2010-08-20 16:52 UTC by Jorge Castro
Modified: 2015-04-13 10:16 UTC (History)
4 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments

Description Jorge Castro 2010-08-20 16:52:50 UTC
When I plug in an Amazon Kindle it shows up as an MP3 player, not as an ebook reader. As a result Nautilus shows me an mp3 player icon on the desktop, and has a bar in the UI that says "These files are on a digital audio player" and a button to open Rhythmbox.

While the Kindle is an MP3 player, it's primary use is as an ebook reader, so I would think that by default it would show an icon based on the hardware like we do for ipods (with whatever color the Kindle is, etc.) and then clicking on the icon would open it like a normal USB key and instead Nautilus would say "These files are on a ebook reader" and the button recommends whatever ebook app the user has installed (Calibre or whatever)

Here's the info:


jorge@bojack:~$ udevadm info -q all -n /dev/sdc
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host13/target13:0:0/13:0:0:0/block/sdc
N: sdc
W: 101
S: block/8:32
S: disk/by-id/usb-Kindle_Internal_Storage_B003B0A20093188E-0:0
S: disk/by-path/pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host13/target13:0:0/13:0:0:0/block/sdc
E: MAJOR=8
E: MINOR=32
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: SUBSYSTEM=block
E: ID_MEDIA_PLAYER=amazon-kindle
E: ID_VENDOR=Kindle
E: ID_VENDOR_ENC=Kindle\x20\x20
E: ID_VENDOR_ID=1949
E: ID_MODEL=Internal_Storage
E: ID_MODEL_ENC=Internal\x20Storage
E: ID_MODEL_ID=0002
E: ID_REVISION=0100
E: ID_SERIAL=Kindle_Internal_Storage_B003B0A20093188E-0:0
E: ID_SERIAL_SHORT=B003B0A20093188E
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0
E: ID_PART_TABLE_TYPE=dos
E: UDISKS_PRESENTATION_NOPOLICY=0
E: UDISKS_PARTITION_TABLE=1
E: UDISKS_PARTITION_TABLE_SCHEME=mbr
E: UDISKS_PARTITION_TABLE_COUNT=1
E: UDISKS_PRESENTATION_ICON_NAME=multimedia-player
E: DEVLINKS=/dev/block/8:32 /dev/disk/by-id/usb-Kindle_Internal_Storage_B003B0A20093188E-0:0 /dev/disk/by-path/pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0

jorge@bojack:~$ gvfs-mount -li
Drive(0): Kindle Internal Storage
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/sdc'
  themed icons:  [multimedia-player]  [multimedia]
  is_media_removable=1
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=1
  can_eject=1
  can_start=0
  can_stop=1
  start_stop_type=shutdown
  Volume(0): Kindle
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    ids:
     uuid: '00A4-2ECE'
     unix-device: '/dev/sdc1'
     label: 'Kindle'
    themed icons:  [multimedia-player]  [multimedia]
    can_mount=1
    can_eject=1
    should_automount=1
    Mount(0): Kindle -> file:///media/Kindle_
      Type: GProxyMount (GProxyVolumeMonitorGdu)
      default_location=file:///media/Kindle_
      themed icons:  [multimedia-player]  [multimedia]
      x_content_types: x-content/audio-player
      can_unmount=1
      can_eject=1
      is_shadowed=0
Drive(1): Generic Flash HS-COMBO
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/sde'
  themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
  is_media_removable=1
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=1
  can_eject=1
  can_start=0
  can_stop=1
  start_stop_type=shutdown
  Volume(0): 2.0 GB Filesystem
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    ids:
     uuid: '6AB1-8836'
     unix-device: '/dev/sde1'
    themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
    can_mount=1
    can_eject=1
    should_automount=1
    Mount(0): 2.0 GB Filesystem -> file:///media/6AB1-8836
      Type: GProxyMount (GProxyVolumeMonitorGdu)
      default_location=file:///media/6AB1-8836
      themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
      x_content_types: x-content/image-dcf
      can_unmount=1
      can_eject=1
      is_shadowed=0
Drive(2): Generic Flash HS-CF
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/sdd'
  themed icons:  [drive-removable-media-usb]  [drive-removable-media]  [drive-removable]  [drive]
  is_media_removable=1
  has_media=0
  is_media_check_automatic=1
  can_poll_for_media=1
  can_eject=0
  can_start=0
  can_stop=1
  start_stop_type=shutdown
Drive(3): CD/DVD Drive
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/sr0'
  themed icons:  [drive-optical]  [drive]
  is_media_removable=1
  has_media=0
  is_media_check_automatic=1
  can_poll_for_media=1
  can_eject=0
  can_start=0
  can_stop=0
  start_stop_type=unknown
Mount(0): Backup -> file:///home/jorge/Backup
  Type: GProxyMount (GProxyVolumeMonitorGdu)
  default_location=file:///home/jorge/Backup
  themed icons:  [drive-harddisk]  [drive]
  can_unmount=1
  can_eject=0
  is_shadowed=0
Comment 1 Bastien Nocera 2010-08-20 17:12:52 UTC
Adding an ebook reader type is easy (it's a couple of lines in shared-mime-info). Then you'd need applications to register that type, and something to install a udev rule to add that capability.

The only thing in gvfs would be something in the volume monitor to do "udev rule -> x-content mimetype".
Comment 2 Bastien Nocera 2010-08-20 17:17:09 UTC
Added x-content/ebook-reader to shared-mime-info master.
Comment 3 Christophe Fergeau 2010-08-20 17:22:13 UTC
We could add an extra key to /usr/share/media-player/info/amazon-kindle.mpi to indicate it's an ebook reader, gvfs could then pick that up to do the right thing.
Comment 4 David Zeuthen (not reading bugmail) 2010-08-20 18:21:16 UTC
Right, we're talking about a couple of things here

 1. Get the x-content/ebook-reader type - DONE cf. comment 2

 2. Get media-player-info to convey information about this

 3. Actually get GVfs to read this information. We don't do this
    (except for gphoto2 and afc mounts), but it seems Ubuntu (the
    reporter is using Ubunutu) has a patch to do this via a kludge
    that isn't upstream:

++  /* also add media player if we have the multimedia-player icon (or a variant
++   * like multimedia-player-ipod-white); basing this on the icon is a kludge,
++   * better solution is being discussed in FD#24500 */
++  if (device != NULL)
++    {
++      const char* icon = gdu_device_get_presentation_icon_name (device);
++      if (icon != NULL && g_str_has_prefix (icon, "multimedia-player"))
++        g_ptr_array_add (p, g_strdup ("x-content/audio-player"));
++    }
++

    This links to http://bugs.freedesktop.org/show_bug.cgi?id=24500

 4. Make the docs for 

      http://library.gnome.org/devel/gio/unstable/GMount.html#g-mount-guess-content-type

    mention that the order matters: Earlier types takes precedence over
    the latter ones.

 5. Hack up Nautilus to use the information in 4. In particular, only
    display a prompt for the first type.

Note You need to log in before you can comment on or make changes to this bug.