coherence.backends.tracker_storage (module)¶
-
class
Container
(id, parent_id, name, store=None, children_callback=None, container_class=<class 'coherence.upnp.core.DIDLLite.Container'>)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'tracker_store'¶
-
get_children
(start=0, end=0)[source]¶ Called by the CDS and the MediaServer web.
Parameters: Returns: - a list of its childs, from start to end.
- or a Deferred
-
get_child_count
()[source]¶ Called by the CDS.
Returns: - the number of its childs - len(childs)
- or a Deferred
-
get_item
()[source]¶ Called by the CDS and the MediaServer web.
Returns: - an UPnP ContentDirectoryServer DIDLLite object
- or a Deferred
-
-
class
Artist
(store, id, name)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'tracker_store'¶
-
get_children
(start=0, end=0)[source]¶ Called by the CDS and the MediaServer web.
Parameters: Returns: - a list of its childs, from start to end.
- or a Deferred
-
get_child_count
()[source]¶ Called by the CDS.
Returns: - the number of its childs - len(childs)
- or a Deferred
-
-
class
Album
(store, id, title, artist)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'tracker_store'¶
-
get_children
(start=0, end=0)[source]¶ Called by the CDS and the MediaServer web.
Parameters: Returns: - a list of its childs, from start to end.
- or a Deferred
-
get_child_count
()[source]¶ Called by the CDS.
Returns: - the number of its childs - len(childs)
- or a Deferred
-
get_item
(parent_id=103)[source]¶ Called by the CDS and the MediaServer web.
Returns: - an UPnP ContentDirectoryServer DIDLLite object
- or a Deferred
-
-
class
Track
(store, id, parent_id, file, title, artist, album, genre, duration, track_number, size, mimetype)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'tracker_store'¶
-
get_children
(start=0, end=0)[source]¶ Called by the CDS and the MediaServer web.
Parameters: Returns: - a list of its childs, from start to end.
- or a Deferred
-
get_child_count
()[source]¶ Called by the CDS.
Returns: - the number of its childs - len(childs)
- or a Deferred
-
get_item
(parent_id=None)[source]¶ Called by the CDS and the MediaServer web.
Returns: - an UPnP ContentDirectoryServer DIDLLite object
- or a Deferred
-
-
class
Video
(store, id, parent_id, file, title, duration, size, mimetype)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'tracker_store'¶
-
get_children
(start=0, end=0)[source]¶ Called by the CDS and the MediaServer web.
Parameters: Returns: - a list of its childs, from start to end.
- or a Deferred
-
get_child_count
()[source]¶ Called by the CDS.
Returns: - the number of its childs - len(childs)
- or a Deferred
-
get_item
(parent_id=None)[source]¶ Called by the CDS and the MediaServer web.
Returns: - an UPnP ContentDirectoryServer DIDLLite object
- or a Deferred
-
-
class
Image
(store, id, parent_id, file, title, album, date, width, height, size, mimetype)[source]¶ Bases:
coherence.backend.BackendItem
-
logCategory
= 'tracker_store'¶
-
get_children
(start=0, end=0)[source]¶ Called by the CDS and the MediaServer web.
Parameters: Returns: - a list of its childs, from start to end.
- or a Deferred
-
get_child_count
()[source]¶ Called by the CDS.
Returns: - the number of its childs - len(childs)
- or a Deferred
-
get_item
(parent_id=None)[source]¶ Called by the CDS and the MediaServer web.
Returns: - an UPnP ContentDirectoryServer DIDLLite object
- or a Deferred
-
-
class
TrackerStore
(server, **kwargs)[source]¶ Bases:
coherence.backend.BackendStore
- This is a backend to Meta Tracker:
- http://www.gnome.org/projects/tracker/index.html
Changed in version 0.9.0: Migrated from louie/dispatcher to EventDispatcher
-
implements
= ['MediaServer']¶
-
logCategory
= 'tracker_store'¶
-
get_by_id
(id)[source]¶ Parameters: id (object) – is the id property of our DIDLLite item Returns: - None when no matching item for that id is found,
- a BackendItem,
- or a Deferred
Called by the CDS or the MediaServer web.
Note
if this MediaServer implements containers that can share their content, like ‘all tracks’, ‘album’ and ‘album_of_artist’ (they all have the same track item as content), then the id may be passed by the CDS like this:
‘id@container’ or ‘id@container@container@container…’therefore a
if isinstance(id, basestring): id = id.split('@',1) id = id[0]
may be appropriate as the first thing to do when entering this method.