Fix a MAFW filename encoding issue on Maemo 5

This commit is contained in:
Thomas Perl 2010-08-28 20:30:17 +02:00
parent 52ee5e897b
commit bea6c0e4ca

View file

@ -178,6 +178,8 @@ class MafwPlaybackMonitor(object):
def object_id_to_filename(self, object_id):
# Naive, but works for now...
if object_id.startswith('localtagfs::'):
if isinstance(object_id, unicode):
object_id = object_id.encode('utf-8')
return 'file://'+urllib.quote(urllib.unquote(object_id[object_id.index('%2F'):]))
elif object_id.startswith('urisource::'):
return object_id[len('urisource::'):]