summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--bindings/python/ipod.py10
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 11b9c87..37ab1b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,9 @@
* bindings/python/tests/tests.py:
Whitespace cleanup
+ * bindings/python/ipod.py:
+ Set the mediatype field for Track objects
+
2008-08-20 Todd Zullinger <tmzullinger at users.sourceforge.net>
* bindings/python/examples/save_photos.py
diff --git a/bindings/python/ipod.py b/bindings/python/ipod.py
index 85f5456..4c82ebe 100644
--- a/bindings/python/ipod.py
+++ b/bindings/python/ipod.py
@@ -297,13 +297,18 @@ class Track:
k.startswith("reserved") or
k == "chapterdata")]
- def __init__(self, filename=None,
+ def __init__(self, filename=None, mediatype=gpod.ITDB_MEDIATYPE_AUDIO,
proxied_track=None, podcast=False, ownerdb=None):
"""Create a Track object.
If from_file or filename is set, the file specified will be
used to create the track.
+ The mediatype parameter sets the mediatype for the track. It
+ defaults to audio, unless 'podcast' is True, in which case it
+ is set to podcast. See gpod.ITDB_MEDIATYPE_* for other valid
+ mediatypes.
+
If proxied_track is set, it is expected to be an Itdb_Track
object.
@@ -357,6 +362,8 @@ class Track:
else:
self._track = gpod.itdb_track_new()
self.set_podcast(podcast)
+ if not 'mediatype' in self:
+ self['mediatype'] = mediatype
def _set_userdata_utf8(self, key, value):
self['userdata']['%s_locale' % key] = value
@@ -440,6 +447,7 @@ class Track:
self['skip_when_shuffling'] = 0x01
self['remember_playback_position'] = 0x01
self['flag4'] = 0x01 # Show Title/Album on the 'Now Playing' page
+ self['mediatype'] = gpod.ITDB_MEDIATYPE_PODCAST
else:
self['skip_when_shuffling'] = 0x00
self['remember_playback_position'] = 0x00