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);
const artSize = 96;
const artSize = 96 * (window.devicePixelRatio || 1);
const ytPath = "_youtube";
let ytLimit = 3;
@ -1240,12 +1240,15 @@ class Queue extends Component {
if (name === null) { return; }
name = escape(name);
const commands = items.map(item => {
return `playlistadd "${escape(name)}" "${escape(item.file)}"`;
});
commands.unshift(`rm "${escape(name)}"`);
try { // might not exist
await this._mpd.command(`rm "${name}"`);
} catch (e) {}
const commands = items.map(item => {
return `playlistadd "${name}" "${escape(item.file)}"`;
});
await this._mpd.command(commands);
sel.clear();
}, {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 let ytLimit = 3;

View file

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