|
a/src/mediaserver/cdplugins/uprcl/uprclutils.py |
|
b/src/mediaserver/cdplugins/uprcl/uprclutils.py |
|
... |
|
... |
22 |
import mutagen
|
22 |
import mutagen
|
23 |
try:
|
23 |
try:
|
24 |
from cStringIO import StringIO
|
24 |
from cStringIO import StringIO
|
25 |
except ImportError:
|
25 |
except ImportError:
|
26 |
from StringIO import StringIO
|
26 |
from StringIO import StringIO
|
|
|
27 |
|
|
|
28 |
from upmplgutils import uplog
|
27 |
|
29 |
|
28 |
# This must be consistent with what contentdirectory.cxx does
|
30 |
# This must be consistent with what contentdirectory.cxx does
|
29 |
g_myprefix = '0$uprcl$'
|
31 |
g_myprefix = '0$uprcl$'
|
30 |
|
32 |
|
31 |
audiomtypes = frozenset([
|
33 |
audiomtypes = frozenset([
|
|
... |
|
... |
298 |
if upnpclass:
|
300 |
if upnpclass:
|
299 |
ret['upnp:class'] = upnpclass
|
301 |
ret['upnp:class'] = upnpclass
|
300 |
else:
|
302 |
else:
|
301 |
ret['upnp:class'] = 'object.container'
|
303 |
ret['upnp:class'] = 'object.container'
|
302 |
return ret
|
304 |
return ret
|
303 |
|
|
|
304 |
|
|
|
305 |
def uplog(s):
|
|
|
306 |
if not isinstance(s, unicode):
|
|
|
307 |
s = s.decode('utf-8', errors='replace')
|
|
|
308 |
print("%s: %s" % ('uprcl', s), file=sys.stderr)
|
|
|
309 |
|
305 |
|
310 |
|
306 |
|
311 |
# Parse string into (possibly multiword) tokens
|
307 |
# Parse string into (possibly multiword) tokens
|
312 |
# 'a b "one phrase" c' -> [a, b, 'one phrase', c]
|
308 |
# 'a b "one phrase" c' -> [a, b, 'one phrase', c]
|
313 |
def stringToStrings(str):
|
309 |
def stringToStrings(str):
|