playlist fix, retina art size

This commit is contained in:
Ondřej Žára 2020-12-25 20:53:59 +01:00
parent c04b8f633b
commit bbdeb4d638
No known key found for this signature in database
GPG key ID: B0A5751E616840C5
3 changed files with 16 additions and 10 deletions

View file

@ -816,7 +816,7 @@ class Menu extends Component {
customElements.define("cyp-menu", Menu); customElements.define("cyp-menu", Menu);
const artSize = 96; const artSize = 96 * (window.devicePixelRatio || 1);
const ytPath = "_youtube"; const ytPath = "_youtube";
let ytLimit = 3; let ytLimit = 3;
@ -1240,12 +1240,15 @@ class Queue extends Component {
if (name === null) { return; } if (name === null) { return; }
name = escape(name); name = escape(name);
const commands = items.map(item => { try { // might not exist
return `playlistadd "${escape(name)}" "${escape(item.file)}"`; await this._mpd.command(`rm "${name}"`);
}); } catch (e) {}
commands.unshift(`rm "${escape(name)}"`);
const commands = items.map(item => {
return `playlistadd "${name}" "${escape(item.file)}"`;
});
await this._mpd.command(commands); await this._mpd.command(commands);
sel.clear(); sel.clear();
}, {label:"Save", icon:"content-save"}); }, {label:"Save", icon:"content-save"});

View file

@ -1,4 +1,4 @@
export const artSize = 96; export const artSize = 96 * (window.devicePixelRatio || 1);
export const ytPath = "_youtube"; export const ytPath = "_youtube";
export let ytLimit = 3; export let ytLimit = 3;

View file

@ -96,12 +96,15 @@ class Queue extends Component {
if (name === null) { return; } if (name === null) { return; }
name = escape(name); name = escape(name);
const commands = items.map(item => { try { // might not exist
return `playlistadd "${escape(name)}" "${escape(item.file)}"`; await this._mpd.command(`rm "${name}"`);
}); } catch (e) {}
commands.unshift(`rm "${escape(name)}"`);
const commands = items.map(item => {
return `playlistadd "${name}" "${escape(item.file)}"`;
});
await this._mpd.command(commands); await this._mpd.command(commands);
sel.clear(); sel.clear();
}, {label:"Save", icon:"content-save"}); }, {label:"Save", icon:"content-save"});