coherence.backends.elisa_storage (module) — Cohen3 0.8.0 documentation

# coherence.backends.elisa_storage (module)

class `ElisaMediaStore`(server, **kwargs)

  Bases: `coherence.backend.Backend`

  This is a backend to the Elisa Media DB

  Elisa needs to expose two methods

      get_root_id(media_type)
          if media_type == '*'
              this returns the root id of the media collection
          if media_type == 'audio'
              this returns the root id of the audio collection

      get_item_by_id(id)
          this returns a dict with the following keys:
          id = id in the media db
          parent_id = parent_id in the media db
          name = title, album name or basename
          mimetype = 'directory' or real mimetype
          children = list of objects for which this item is the parent
          location = filesystem path if item is a file
          cover = url by which the cover image can be retrieved  (OPTIONAL)
          size = in bytes (OPTIONAL)

  Changed in version 0.9.0:

  - Migrated from louie/dispatcher to EventDispatcher

  - Introduced `Backend`’s inheritance

  `implements` = ['MediaServer']
  `get_store`()
  `get_by_id`(id)
  `set_root_id`(id)
  `get_root_id`(media_type='audio')

    ask Elisa to tell us the id of the top item representing the media_type == ‘something’ collection

  `upnp_init`()

    This method gets called after the device is fired, here all initializations of service related state variables should happen, as the services aren’t available before that point.

  `upnp_Browse`(*args, **kwargs)