mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-27 12:48:01 +02:00
fmt fixes
This commit is contained in:
parent
b023b67e04
commit
b807cf1907
6 changed files with 25 additions and 26 deletions
18
src/App.vue
18
src/App.vue
|
@ -95,27 +95,23 @@ function parseUrl() {
|
|||
|
||||
function setupKeys() {
|
||||
window.addEventListener('keydown', e => {
|
||||
if (
|
||||
!e.shiftKey ||
|
||||
e.repeat ||
|
||||
'string' == typeof e.target.value
|
||||
) return
|
||||
|
||||
if (!e.shiftKey || e.repeat || 'string' == typeof e.target.value) return;
|
||||
|
||||
switch (e.code) {
|
||||
case 'Space':
|
||||
player.toggle('play')
|
||||
player.toggle('play');
|
||||
break;
|
||||
case 'Slash':
|
||||
nav.show()
|
||||
nav.show();
|
||||
break;
|
||||
case 'KeyN':
|
||||
data.nextTrack()
|
||||
data.nextTrack();
|
||||
break;
|
||||
case 'KeyP':
|
||||
data.prevTrack()
|
||||
data.prevTrack();
|
||||
break;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function playThis(t) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"date": "2023-09-02"
|
||||
"date": "2023-09-22"
|
||||
}
|
||||
|
|
|
@ -62,7 +62,8 @@ async function Stream() {
|
|||
window.offline = new shaka.offline.Storage(audioPlayer);
|
||||
window.offline.configure({
|
||||
offline: {
|
||||
progressCallback: ({ appMetadata: { title, artist } }, prog) => a.add(`${title} by ${artist}: ${Math.floor(prog*100)}%`),
|
||||
progressCallback: ({ appMetadata: { title, artist } }, prog) =>
|
||||
a.add(`${title} by ${artist}: ${Math.floor(prog * 100)}%`),
|
||||
trackSelectionCallback: tracks => [
|
||||
tracks
|
||||
.sort((a, b) => a.bandwidth - b.bandwidth)
|
||||
|
|
|
@ -16,9 +16,9 @@ function search(e) {
|
|||
watch(
|
||||
() => nav.state.show,
|
||||
e => {
|
||||
if (e === true) setTimeout(() => searchEl.value.focus(), 0)
|
||||
}
|
||||
)
|
||||
if (e === true) setTimeout(() => searchEl.value.focus(), 0);
|
||||
},
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -40,15 +40,17 @@ function getFormattedTime(sec) {
|
|||
|
||||
async function Offline() {
|
||||
if (window.offline && data.state.url) {
|
||||
window.offline.store(window.audioPlayer.getAssetUri(), {
|
||||
title: data.state.title,
|
||||
url: data.state.url,
|
||||
artist: data.state.artist,
|
||||
artistUrl: data.state.artistUrl,
|
||||
}).promise.catch(e => {
|
||||
console.error(e)
|
||||
a.add('Error: ' + e.code)
|
||||
});
|
||||
window.offline
|
||||
.store(window.audioPlayer.getAssetUri(), {
|
||||
title: data.state.title,
|
||||
url: data.state.url,
|
||||
artist: data.state.artist,
|
||||
artistUrl: data.state.artistUrl,
|
||||
})
|
||||
.promise.catch(e => {
|
||||
console.error(e);
|
||||
a.add('Error: ' + e.code);
|
||||
});
|
||||
} else a.add('offline storage not found');
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ export const useNav = defineStore('nav', () => {
|
|||
show: false,
|
||||
});
|
||||
|
||||
const show = () => state.show = !state.show
|
||||
const show = () => (state.show = !state.show);
|
||||
|
||||
return { state, show };
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue