summaryrefslogtreecommitdiff
path: root/libs/music/player.d
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-12-05 15:04:58 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-12-05 15:04:58 +0800
commit6537544b908dd19aa88886746eacd28ec2fd98b2 (patch)
treef2e496eba18152513488d5b2088636af46cca599 /libs/music/player.d
parentf112c9977963edfca2ddba6de2ef83f0d8979cf4 (diff)
downloadweb-6537544b908dd19aa88886746eacd28ec2fd98b2.tar.xz
let's get it actually working, shall we?
Diffstat (limited to 'libs/music/player.d')
-rwxr-xr-xlibs/music/player.d/cgi-bin/pcm.cgi10
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))