diff options
author | Chris Xiong <chirs241097@gmail.com> | 2021-11-23 00:36:02 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2021-11-23 00:36:02 +0800 |
commit | d8b53507757ef7008a44812e8fbd3376eacba0e2 (patch) | |
tree | 515d7f4926ee2b2877e734e6a92f81e7acc61cd3 /libs/music/player.d/cgi-bin | |
parent | aefc8e8dbe12d716bb1b46ea2d6281c79958b6cd (diff) | |
download | web-d8b53507757ef7008a44812e8fbd3376eacba0e2.tar.xz |
Make pcm.cgi more compliant with the current pcm api.
Also try to fix some shit (may break it even more).
Diffstat (limited to 'libs/music/player.d/cgi-bin')
-rwxr-xr-x | libs/music/player.d/cgi-bin/pcm.cgi | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/music/player.d/cgi-bin/pcm.cgi b/libs/music/player.d/cgi-bin/pcm.cgi index e43262f..2d5eaca 100755 --- a/libs/music/player.d/cgi-bin/pcm.cgi +++ b/libs/music/player.d/cgi-bin/pcm.cgi @@ -7,6 +7,8 @@ print('Status: 200 OK',end='\r\n') print('Content-type: application/json',end='\r\n') print(end='\r\n') +fmt='ogg' if 'fmt' not in d else d['fmt'] + ro={'status':200,'message':'OK'} if 'folder' not in d or d['folder']=='': plp=os.environ['DOCUMENT_ROOT']+'/libs/music/player.d/playlists/playlists' @@ -25,7 +27,8 @@ else: for line in f: line=line.strip() if len(line)>0: - alblist.append({'fileName':quote(line),'fileSize':0,'modifiedTime':0}) +#hard code this for now, until pcm api stabilizes + alblist.append({'fileName':quote(line+'.ogg'),'fileSize':0,'modifiedTime':0}) rro={'type':'fileList','data':{'musicList':alblist[1:],'subFolderList':list()}} ro['result']=rro print(json.dumps(ro)) |