Module playlist
source code
Code to handle Playlist items.
The playlist data includes 2 components: the list of available songs, and
the playlist items.
The format of the Playlist items is standardized. It is a list of dict which
has the following standard fields:
name: string=the name of the play list
type: string=the type of this play list. Current supported types are mp3 and wma.
songs: [ 'song name', ... ]
To implement Playlist read/write for a phone module:
1. Add 2 entries into Profile._supportedsyncs:
...
('playlist', 'read', 'OVERWRITE'),
('playlist', 'write', 'OVERWRITE'),
2. Implement the following 2 methods in your Phone class:
def getplaylist(self, result)
def saveplaylist(self, result, merge)
The result dict should have:
results[playlist.masterlist_key]=['song name 1', 'song name 2', ...]
results[playlist.playlist_key=[playlist.PlaylistEntry, playlist.PlaylistEntry, ..]
masterlistobjectfactory
- Value:
database.dataobjectfactory(MasterListDataObject)
|
|
playlistobjectfactory
- Value:
database.dataobjectfactory(PlaylistDataObject)
|
|
playlistentryobjectfactory
- Value:
database.dataobjectfactory(PlaylistEntryDataObject)
|
|