diff options
author | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-02-10 23:14:23 +0000 |
---|---|---|
committer | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-02-10 23:14:23 +0000 |
commit | 046b624301519f63c6d313b3934915aef659d61d (patch) | |
tree | f2d65f8ee1ea99b4f531ebba530e91b8cc7fc4d4 /bindings | |
parent | b674171ba297607f6dff150bef14929214730b9e (diff) | |
download | libgpod-046b624301519f63c6d313b3934915aef659d61d.tar.gz libgpod-046b624301519f63c6d313b3934915aef659d61d.tar.xz libgpod-046b624301519f63c6d313b3934915aef659d61d.zip |
Translate track attributes to UTF-8 (dropping any chars we can't do), and if there is no title tag in the mp3 then use the filename (not the whole pathname)
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1393 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/ipod.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bindings/python/ipod.py b/bindings/python/ipod.py index 3917e2c..c917bef 100644 --- a/bindings/python/ipod.py +++ b/bindings/python/ipod.py @@ -322,7 +322,7 @@ class Track: except AttributeError: pass if self['title'] is None: - self['title'] = filename + self['title'] = os.path.splitext(os.path.split(filename)[1])[0] try: self['genre'] = tag.getGenre().name except AttributeError: @@ -427,7 +427,7 @@ class Track: gpod.sw_set_track_userdata(self._track, value) return if type(value) == types.UnicodeType: - value = value.encode() + value = value.encode('UTF-8','ignore') if item in self._proxied_attributes: return setattr(self._track, item, value) else: |