summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-12-09 02:51:13 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-12-09 02:51:13 +0800
commitad6aa2f5c9ca896eee57e559b39b43d1a14484f1 (patch)
treec69032ded05ca67843a734a26ea541626135e300 /libs
parentf03d4118421daa4ca5c711dfbbbbbf2cd282e73d (diff)
downloadweb-ad6aa2f5c9ca896eee57e559b39b43d1a14484f1.tar.xz
... shit
Diffstat (limited to 'libs')
-rw-r--r--libs/music/player.d/main_static.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/libs/music/player.d/main_static.js b/libs/music/player.d/main_static.js
index 726b5cf..095f60c 100644
--- a/libs/music/player.d/main_static.js
+++ b/libs/music/player.d/main_static.js
@@ -767,25 +767,25 @@ function init()
sh.elem('overlay').onclick=function(){
try{
NSAudio.audioInit();NSAudio.connect();
- if(window.location.hash.length)
+ }catch(e){return;}
+ if(window.location.hash.length)
+ {
+ let p=window.location.hash.substr(1).split('/');
+ for(let i=0;i<p.length;++i)p[i]=decodeURIComponent(p[i]);
+ NSUI.switch_playlist(p[0],true);
+ let id=0;
+ for(;id<NSPlayer.tracks.length&&NSPlayer.tracks[id].title!=p[1];++id);
+ if(id<NSPlayer.tracks.length)
{
- let p=window.location.hash.substr(1).split('/');
- for(let i=0;i<p.length;++i)p[i]=decodeURIComponent(p[i]);
- NSUI.switch_playlist(p[0],true);
- let id=0;
- for(;id<NSPlayer.tracks.length&&NSPlayer.tracks[id].title!=p[1];++id);
- if(id<NSPlayer.tracks.length)
- {
- const p=NSUI.switch_track(id);
- if(p!=undefined)
- p.then(_=>{sh.elem('overlay').style.display='none';}).catch(e=>{});
- else
- //this browser is from an era before this autoplay policy mess,
- //assume it succeeded
- sh.elem('overlay').style.display='none';
- }
+ const p=NSUI.switch_track(id);
+ if(p!=undefined)
+ p.then(_=>{sh.elem('overlay').style.display='none';}).catch(e=>{});
+ else
+ //this browser is from an era before this autoplay policy mess,
+ //assume it succeeded
+ sh.elem('overlay').style.display='none';
}
- }catch(e){return;}
+ }
}
sh.elem('overlay').onclick();
},