diff options
| author | nicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2006-05-07 21:47:32 +0000 |
|---|---|---|
| committer | nicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2006-05-07 21:47:32 +0000 |
| commit | 12128d94d85c61b0a7de9f6603dd387ea0dce186 (patch) | |
| tree | 82150eac4f80b6cdfb1c2b5784bcdeedc5e93764 /bindings/python/ipod.py | |
| parent | 2052da36ef58561ecc6226ca0b0b5c6b5461f69f (diff) | |
Allow add_song.py to create a playlist to put the new tracks into
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1259 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python/ipod.py')
| -rw-r--r-- | bindings/python/ipod.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bindings/python/ipod.py b/bindings/python/ipod.py index 020ed20..9a2a357 100644 --- a/bindings/python/ipod.py +++ b/bindings/python/ipod.py @@ -113,7 +113,10 @@ class Track: self._track = gpod.itdb_track_new() self['userdata'] = {'filename_locale': from_file, 'transferred': 0} - audiofile = eyeD3.Mp3AudioFile(self['userdata']['filename_locale']) + try: + audiofile = eyeD3.Mp3AudioFile(self['userdata']['filename_locale']) + except eyeD3.tag.InvalidAudioFormatException, e: + raise TrackException(str(e)) tag = audiofile.getTag() for func, attrib in (('getArtist','artist'), ('getTitle','title'), @@ -123,7 +126,10 @@ class Track: value = getattr(tag,func)() if value: self[attrib] = value - self['genre'] = tag.getGenre().name + try: + self['genre'] = tag.getGenre().name + except AttributeError: + pass disc, of = tag.getDiscNum() if disc is not None: self['cd_nr'] = disc @@ -322,5 +328,8 @@ class Playlist: #return self._pl.num # Always 0 ? return gpod.sw_get_list_len(self._pl.members) + def __nonzero__(self): + return True + def add(self, track, pos=-1): gpod.itdb_playlist_add_track(self._pl, track._track, pos) |
