Autodetect iPod mountpoint

Bug #135915 reported by Adam Olsen
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
In Progress
Wishlist
Unassigned

Bug Description

{{{
    def detect_ipod(self):
        bus = dbus.SystemBus()
        try:
            hal_manager_obj = bus.get_object('org.freedesktop.Hal',
                '/org/freedesktop/Hal/Manager')
            hal_manager = dbus.Interface(hal_manager_obj,
                'org.freedesktop.Hal.Manager')
            dev_udi_list = hal_manager.FindDeviceStringMatch ('portable_audio_player.type', 'ipod')
            for udi in dev_udi_list:
                vol_udi_list = hal_manager.FindDeviceStringMatch ('info.parent', udi)

                for vol_udi in vol_udi_list:
                    vol_obj = bus.get_object ('org.freedesktop.Hal', vol_udi)
                    vol = dbus.Interface (vol_obj, 'org.freedesktop.Hal.Device')

                    if not vol.GetProperty('volume.is_mounted'):
                        continue;

                    return (vol.GetProperty('block.device').encode(sys.getfilesystemencoding()),
                        vol.GetProperty('volume.mount_point').encode(sys.getfilesystemencoding()))
        except None:
            print 'HAL is down.'

        return None
}}}

You can also connect to the "device connected," "device disconnected" and "device changed" HAL signals to automatically detect when the device is available.

This ticket was migrated from the old trac: re #5

Tags: ipod
Changed in exaile:
importance: Undecided → Wishlist
status: New → Confirmed
reacocard (reacocard)
Changed in exaile:
milestone: none → 0.3.0
Revision history for this message
bear (bear42) wrote :

The attached patch fixes the iPod auto-detect for plugins and also when iPod is already attached

Revision history for this message
bear (bear42) wrote :

looks like my patch continued the work of bug 331047 - just noting here for my own benefit

Revision history for this message
reacocard (reacocard) wrote :

deferring to 0.3.1

Changed in exaile:
milestone: 0.3.0 → 0.3.1
Changed in exaile:
status: Confirmed → In Progress
reacocard (reacocard)
tags: added: ipod
reacocard (reacocard)
Changed in exaile:
milestone: 0.3.1 → none
Revision history for this message
Stephen Allen (stephen-d-allen) wrote :

HAL is deprecated and Exaile still doesn't mount iPod

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.