|
a/src/mediaserver/cdplugins/uprcl/uprclutils.py |
|
b/src/mediaserver/cdplugins/uprcl/uprclutils.py |
|
... |
|
... |
121 |
path = path[7:]
|
121 |
path = path[7:]
|
122 |
if 'tt' not in li:
|
122 |
if 'tt' not in li:
|
123 |
li['tt'] = os.path.basename(path.decode('UTF-8', errors = 'replace'))
|
123 |
li['tt'] = os.path.basename(path.decode('UTF-8', errors = 'replace'))
|
124 |
path = os.path.join(pathprefix, path)
|
124 |
path = os.path.join(pathprefix, path)
|
125 |
li['uri'] = "http://%s%s" % (httphp, urllib.quote(path))
|
125 |
li['uri'] = "http://%s%s" % (httphp, urllib.quote(path))
|
|
|
126 |
#uplog("rcldoctoentry: uri: %s" % li['uri'])
|
126 |
|
127 |
|
127 |
# The album art uri is precooked with httphp and prefix
|
128 |
# The album art uri is precooked with httphp and prefix
|
128 |
if doc.albumarturi:
|
129 |
if doc.albumarturi:
|
129 |
li['upnp:albumArtURI'] = doc.albumarturi
|
130 |
li['upnp:albumArtURI'] = doc.albumarturi
|
130 |
#uplog("Set upnp:albumArtURI to %s" % li['upnp:albumArtURI'])
|
131 |
#uplog("Set upnp:albumArtURI to %s" % li['upnp:albumArtURI'])
|
131 |
|
132 |
|
132 |
#uplog("rcldoctoentry: uri: %s" % li['uri'])
|
|
|
133 |
return li
|
133 |
return li
|
134 |
|
134 |
|
135 |
def docfolder(doc):
|
135 |
def docfolder(doc):
|
136 |
path = doc.getbinurl()
|
136 |
path = doc.getbinurl()
|
137 |
path = path[7:]
|
137 |
path = path[7:]
|
|
... |
|
... |
204 |
#uplog("docarturi: external: %s->%s" %
|
204 |
#uplog("docarturi: external: %s->%s" %
|
205 |
# (printable(folder), printable(arturi)))
|
205 |
# (printable(folder), printable(arturi)))
|
206 |
pass
|
206 |
pass
|
207 |
return arturi
|
207 |
return arturi
|
208 |
|
208 |
|
|
|
209 |
def _keyvalornull(a, k):
|
|
|
210 |
return a[k] if k in a else "NULL"
|
|
|
211 |
def _logentry(nm, e1):
|
|
|
212 |
tp = _keyvalornull(e1,'tp')
|
|
|
213 |
al = _keyvalornull(e1, 'upnp:album')
|
|
|
214 |
dr = os.path.dirname(_keyvalornull(e1, 'uri'))
|
|
|
215 |
tn = _keyvalornull(e1, 'upnp:originalTrackNumber')
|
|
|
216 |
uplog("%s tp %s alb %s dir %s tno %s" % (nm, tp,al,dr,tn))
|
209 |
|
217 |
|
210 |
def cmpentries(e1, e2):
|
218 |
def cmpentries(e1, e2):
|
|
|
219 |
#uplog("cmpentries");_logentry("e1", e1);_logentry("e2", e2)
|
211 |
tp1 = e1['tp']
|
220 |
tp1 = e1['tp']
|
212 |
tp2 = e2['tp']
|
221 |
tp2 = e2['tp']
|
213 |
isct1 = tp1 == 'ct'
|
222 |
isct1 = tp1 == 'ct'
|
214 |
isct2 = tp2 == 'ct'
|
223 |
isct2 = tp2 == 'ct'
|
215 |
|
224 |
|