--- a/src/pyams_media/media.py Wed Sep 20 14:04:57 2017 +0200
+++ b/src/pyams_media/media.py Wed Sep 20 14:05:34 2017 +0200
@@ -103,7 +103,7 @@
result.append(self.__parent__)
result.extend(list(self.values()))
if order:
- order = tuple(map(lambda x: x.encode(), order))
+ order = tuple(map(lambda x: x.decode() if isinstance(x, bytes) else x, order))
result.sort(key=lambda x: (order.index(x.content_type) if x.content_type in order else 999,
self.get_conversion_width(x.filename) or 9999))
return result