|
|
|
@ -271,8 +271,9 @@ class PysonicApi(object):
|
|
|
|
|
moreargs.update(name=child["name"], |
|
|
|
|
isDir="true", # TODO song files in artist dir |
|
|
|
|
parent=entity["id"], |
|
|
|
|
coverArt=child["coverid"], |
|
|
|
|
id=child["dir"]) |
|
|
|
|
if child["coverid"]: |
|
|
|
|
moreargs.update(coverArt=child["coverid"]) |
|
|
|
|
# album=item["name"], |
|
|
|
|
# title=item["name"], # TODO dupe? |
|
|
|
|
# artist=artist["name"], |
|
|
|
@ -281,13 +282,14 @@ class PysonicApi(object):
|
|
|
|
|
moreargs.update(name=child["title"], |
|
|
|
|
artist=child["_artist"]["name"], |
|
|
|
|
contentType=child["format"], |
|
|
|
|
coverArt=entity["coverid"], |
|
|
|
|
id=child["id"], # this is probably fucked ? |
|
|
|
|
id=child["id"], |
|
|
|
|
duration=child["length"], |
|
|
|
|
isDir="false", |
|
|
|
|
parent=entity["dir"], |
|
|
|
|
# title=xxx |
|
|
|
|
) |
|
|
|
|
if entity["coverid"]: |
|
|
|
|
moreargs.update(coverArt=entity["coverid"]) |
|
|
|
|
# duration="230" size="8409237" suffix="mp3" track="2" year="2005"/> |
|
|
|
|
response.add_child("child", _parent="directory", |
|
|
|
|
size="4096", |
|
|
|
@ -346,11 +348,7 @@ class PysonicApi(object):
|
|
|
|
|
maxBitRate = int(maxBitRate) |
|
|
|
|
assert maxBitRate >= 32 and maxBitRate <= 320 |
|
|
|
|
song = self.library.get_song(id) |
|
|
|
|
fpath = "library/" + song["file"] |
|
|
|
|
# import pdb |
|
|
|
|
# from pprint import pprint |
|
|
|
|
# pdb.set_trace() |
|
|
|
|
# meta = self.library.get_file_metadata(id) |
|
|
|
|
fpath = song["_fullpath"] |
|
|
|
|
to_bitrate = min(maxBitRate, self.options.max_bitrate, song.get("bitrate", 320 * 1024) / 1024) |
|
|
|
|
cherrypy.response.headers['Content-Type'] = 'audio/mpeg' |
|
|
|
|
#if "media_length" in meta: |
|
|
|
@ -416,7 +414,7 @@ class PysonicApi(object):
|
|
|
|
|
@cherrypy.expose |
|
|
|
|
def getCoverArt_view(self, id, **kwargs): |
|
|
|
|
cover = self.library.get_cover(id) |
|
|
|
|
fpath = "library/" + cover["path"] |
|
|
|
|
fpath = cover["_fullpath"] |
|
|
|
|
type2ct = { |
|
|
|
|
'jpg': 'image/jpeg', |
|
|
|
|
'png': 'image/png', |
|
|
|
|