summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authornicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2007-02-10 23:14:23 +0000
committernicholas <nicholas@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2007-02-10 23:14:23 +0000
commit9f8196ca9368731446c7fc96a0982c3ab010218a (patch)
treef2d65f8ee1ea99b4f531ebba530e91b8cc7fc4d4 /bindings
parent4f1a049d82d94fd0fba6a2de3c7662c9e78441f9 (diff)
downloadlibgpod-9f8196ca9368731446c7fc96a0982c3ab010218a.tar.gz
libgpod-9f8196ca9368731446c7fc96a0982c3ab010218a.tar.xz
libgpod-9f8196ca9368731446c7fc96a0982c3ab010218a.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.py4
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: