From 6537544b908dd19aa88886746eacd28ec2fd98b2 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 5 Dec 2021 15:04:58 +0800 Subject: let's get it actually working, shall we? --- libs/music/player.d/cgi-bin/pcm.cgi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libs/music/player.d/cgi-bin') 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)) -- cgit v1.2.3