support showing album-cover on windows lockscreen

This commit is contained in:
ed 2021-06-21 19:15:22 +00:00
parent 3ab1acf32c
commit ec100210dc
2 changed files with 14 additions and 0 deletions

View File

@ -320,6 +320,11 @@ var mpl = (function () {
if (cover) {
cover += (cover.indexOf('?') === -1 ? '?' : '&') + 'th=j';
var pwd = get_pwd();
if (pwd)
cover += '&pw=' + uricom_enc(pwd);
tags.artwork = [{ "src": cover, type: "image/jpeg" }];
}
}

View File

@ -359,6 +359,15 @@ function get_vpath() {
}
function get_pwd() {
var pwd = ('; ' + document.cookie).split('; cppwd=');
if (pwd.length < 2)
return null;
return pwd[1].split(';')[0];
}
function unix2iso(ts) {
return new Date(ts * 1000).toISOString().replace("T", " ").slice(0, -5);
}