From cedefee4e08eff3ac9cfe1037f3c11abb2358bd8 Mon Sep 17 00:00:00 2001 From: Nicholas Piper Date: Sat, 10 Feb 2007 23:14:23 +0000 Subject: 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 --- bindings/python/ipod.py | 4 ++-- 1 file 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: -- cgit