From dc5b27ddd0b1ac3af3eeb3bb28747dd616f77695 Mon Sep 17 00:00:00 2001 From: Alikia2x Date: Mon, 13 May 2024 00:06:47 +0800 Subject: [PATCH] realese: AquaVox 1.8.0 --- package.json | 4 +- src/app.html | 2 +- src/lib/components/cover.svelte | 19 ++++++- src/lib/components/import/fileSelector.svelte | 2 +- src/lib/components/import/sourceCard.svelte | 2 +- src/lib/components/interactiveBox.svelte | 33 ++++++++++- src/lib/components/lyrics.svelte | 53 ++++++++++++++---- src/routes/+page.svelte | 44 ++++++++++++--- src/routes/import/+page.svelte | 1 + src/routes/import/[id]/lyric/+page.svelte | 1 + src/routes/import/local/+page.svelte | 1 + src/routes/play/[id]/+page.svelte | 18 +++++- static/favicon.png | Bin 1571 -> 0 bytes 13 files changed, 148 insertions(+), 32 deletions(-) delete mode 100644 static/favicon.png diff --git a/package.json b/package.json index 3216e6c..f809552 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "aquavox", - "version": "0.0.1", - "private": true, + "version": "1.8.0", + "private": false, "scripts": { "dev": "vite dev", "build": "vite build", diff --git a/src/app.html b/src/app.html index 3b52a7f..e230ef2 100644 --- a/src/app.html +++ b/src/app.html @@ -2,7 +2,7 @@ - + import type { Writable } from 'svelte/store'; export let coverPath: Writable; + export let hasLyrics: boolean; let path: string = ''; coverPath.subscribe((p) => { @@ -8,6 +9,18 @@ }); -封面 +{#if hasLyrics} +封面 +{:else} +封面 +{/if} \ No newline at end of file diff --git a/src/lib/components/import/fileSelector.svelte b/src/lib/components/import/fileSelector.svelte index b28af34..0739632 100644 --- a/src/lib/components/import/fileSelector.svelte +++ b/src/lib/components/import/fileSelector.svelte @@ -6,7 +6,7 @@ import { fileListState } from '$lib/state/fileList.state'; import AddIcon from './addIcon.svelte'; const fileItems = useAtom(fileListState); - export let accept: string = "audio/*"; + export let accept: string = ".aac, .mp3, .wav, .ogg, .flac"; onMount(() => { audioFiles.addEventListener('change', function (e: any) { diff --git a/src/lib/components/import/sourceCard.svelte b/src/lib/components/import/sourceCard.svelte index 8aa3129..35c3ee3 100644 --- a/src/lib/components/import/sourceCard.svelte +++ b/src/lib/components/import/sourceCard.svelte @@ -8,7 +8,7 @@
diff --git a/src/lib/components/interactiveBox.svelte b/src/lib/components/interactiveBox.svelte index 07bedc7..e2f37dd 100644 --- a/src/lib/components/interactiveBox.svelte +++ b/src/lib/components/interactiveBox.svelte @@ -1,5 +1,6 @@ -
-
+{#if showInfoTop} +
{name}
{singer}
+{/if} + +
+ {#if !showInfoTop} +
+ {name}
+ {singer} +
+ {/if} +
{formatDuration(progress)}
{#each lyrics as lyric, i}

@@ -69,6 +69,9 @@ {/if} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index b414144..e2d88e4 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -37,22 +37,33 @@ musicList[id].coverUrl = URL.createObjectURL(v); } idList = Object.keys(musicList); - console.log(musicList); }); + + function clear() { + localforage.clear(); + window.location.reload(); + } -

+ + Aquavox - 音乐库 + + + + + diff --git a/src/routes/import/+page.svelte b/src/routes/import/+page.svelte index 0ec5a65..68a6616 100644 --- a/src/routes/import/+page.svelte +++ b/src/routes/import/+page.svelte @@ -3,6 +3,7 @@ +

AquaVox

导入

希望从哪里导入你的歌曲?

+

AquaVox

歌词导入

当前为 {audioId} 导入歌词

diff --git a/src/routes/import/local/+page.svelte b/src/routes/import/local/+page.svelte index 1f53b2a..e672d26 100644 --- a/src/routes/import/local/+page.svelte +++ b/src/routes/import/local/+page.svelte @@ -12,6 +12,7 @@ const success = useAtom(localImportSuccess); +

AquaVox

本地导入向导

欢迎使用本地导入向导!

diff --git a/src/routes/play/[id]/+page.svelte b/src/routes/play/[id]/+page.svelte index 1b47b20..df97e3a 100644 --- a/src/routes/play/[id]/+page.svelte +++ b/src/routes/play/[id]/+page.svelte @@ -10,6 +10,7 @@ import { writable } from 'svelte/store'; import srtParser2 from 'srt-parser-2'; import type { Line } from 'srt-parser-2'; + import type { IAudioMetadata } from 'music-metadata-browser'; const audioId = $page.params.id; let audioPlayer: HTMLAudioElement; @@ -25,6 +26,7 @@ let originalLyrics: Line[]; let lyricsText: string[] = []; let onAdjustingProgress = false; + let hasLyrics: boolean; const coverPath = writable(''); let mainInterval: ReturnType; @@ -64,8 +66,11 @@ } function readDB() { - getAudioIDMetadata(audioId, (metadata: any) => { + getAudioIDMetadata(audioId, (metadata: IAudioMetadata | null) => { + if (!metadata) return; duration = metadata.format.duration ? metadata.format.duration : 0; + console.log(metadata); + singer = metadata.common.artist ? metadata.common.artist : '未知歌手'; prepared.push('duration'); }); localforage.getItem(`${audioId}-cover`, function (err, file) { @@ -168,6 +173,14 @@ } } + $: { + if (originalLyrics) { + hasLyrics = true; + } else { + hasLyrics = false; + } + } + readDB(); @@ -176,7 +189,7 @@ - + diff --git a/static/favicon.png b/static/favicon.png deleted file mode 100644 index 825b9e65af7c104cfb07089bb28659393b4f2097..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1571 zcmV+;2Hg3HP)Px)-AP12RCwC$UE6KzI1p6{F2N z1VK2vi|pOpn{~#djwYcWXTI_im_u^TJgMZ4JMOsSj!0ma>B?-(Hr@X&W@|R-$}W@Z zgj#$x=!~7LGqHW?IO8+*oE1MyDp!G=L0#^lUx?;!fXv@l^6SvTnf^ac{5OurzC#ZMYc20lI%HhX816AYVs1T3heS1*WaWH z%;x>)-J}YB5#CLzU@GBR6sXYrD>Vw(Fmt#|JP;+}<#6b63Ike{Fuo!?M{yEffez;| zp!PfsuaC)>h>-AdbnwN13g*1LowNjT5?+lFVd#9$!8Z9HA|$*6dQ8EHLu}U|obW6f z2%uGv?vr=KNq7YYa2Roj;|zooo<)lf=&2yxM@e`kM$CmCR#x>gI>I|*Ubr({5Y^rb zghxQU22N}F51}^yfDSt786oMTc!W&V;d?76)9KXX1 z+6Okem(d}YXmmOiZq$!IPk5t8nnS{%?+vDFz3BevmFNgpIod~R{>@#@5x9zJKEHLHv!gHeK~n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