diff options
author | Chris Xiong <chirs241097@gmail.com> | 2021-12-05 15:04:58 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2021-12-05 15:04:58 +0800 |
commit | 6537544b908dd19aa88886746eacd28ec2fd98b2 (patch) | |
tree | f2e496eba18152513488d5b2088636af46cca599 | |
parent | f112c9977963edfca2ddba6de2ef83f0d8979cf4 (diff) | |
download | web-6537544b908dd19aa88886746eacd28ec2fd98b2.tar.xz |
let's get it actually working, shall we?
-rwxr-xr-x | libs/music/player.d/cgi-bin/pcm.cgi | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/music/player.d/cgi-bin/pcm.cgi b/libs/music/player.d/cgi-bin/pcm.cgi index a1dc27f..6e51018 100755 --- a/libs/music/player.d/cgi-bin/pcm.cgi +++ b/libs/music/player.d/cgi-bin/pcm.cgi @@ -4,6 +4,7 @@ from urllib.parse import quote,unquote def getfilelist(d): fmt='ogg' if 'fmt' not in d else d['fmt'] + AUDIO_BASE='//filestorage.chrisoft.org/music/ogg/' ro={'status':200,'message':'OK'} if 'folder' not in d or d['folder']=='': @@ -23,8 +24,13 @@ def getfilelist(d): for line in f: line=line.strip() if len(line)>0: - #hard code this for now, until pcm api stabilizes - alblist.append({'fileName':quote(line+'.ogg'),'fileSize':0,'modifiedTime':0}) + alblist.append({ + 'fileName':quote(line+'.ogg'), + 'url':quote(AUDIO_BASE+line+'.ogg'), + 'displayName':quote(line), + 'fileSize':0, + 'modifiedTime':0 + }) rro={'type':'fileList','data':{'musicList':alblist[1:],'subFolderList':list()}} ro['result']=rro print(json.dumps(ro)) |