File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ func main() {
166166 cantemoToken : os .Getenv ("CANTEMO_TOKEN" ),
167167 })
168168 mux .Handle ("/vault/image" , newVaultImageHandler (cantemoClient , os .Getenv ("CANTEMO_TOKEN" )))
169- mux .Handle ("/vault/waveform" , newVaultWaveformHandler (cantemoClient , os .Getenv ("CANTEMO_TOKEN" )))
170169
171170 mux .Handle ("/" , http .HandlerFunc (serveFiles ))
172171
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -33,20 +33,10 @@ const previewSrc = computed(
3333 ` ${props .base }/vault/image?vxid=${encodeURIComponent (props .item .VXID )}&width=400 ` ,
3434);
3535
36- // /vault/waveform renders a PNG peak-waveform of the audio preview, used
37- // directly in place of a thumbnail for audio items (Cantemo doesn't
38- // auto-generate /thumbnailresource for audio either).
39- const waveformSrc = computed (
40- () =>
41- ` ${props .base }/vault/waveform?vxid=${encodeURIComponent (props .item .VXID )}&width=400&height=120 ` ,
36+ const imgSrc = computed (() =>
37+ imgStage .value === " thumbnail" ? thumbSrc .value : previewSrc .value ,
4238);
4339
44- const imgSrc = computed (() => {
45- if (imgStage .value === " failed" ) return undefined ;
46- if (props .item .mediaType === " audio" ) return waveformSrc .value ;
47- return imgStage .value === " thumbnail" ? thumbSrc .value : previewSrc .value ;
48- });
49-
5040function onImgError() {
5141 if (imgStage .value === " thumbnail" && props .item .mediaType === " image" ) {
5242 imgStage .value = " preview" ;
Original file line number Diff line number Diff line change @@ -34,10 +34,6 @@ const previewSrc = computed(
3434const thumbSrc = computed (
3535 () => ` ${base }/vault/thumbnail?vxid=${encodeURIComponent (vxId .value )} ` ,
3636);
37- const waveformSrc = computed (
38- () =>
39- ` ${base }/vault/waveform?vxid=${encodeURIComponent (vxId .value )}&width=1200&height=200 ` ,
40- );
4137
4238const isVideo = computed (() => item .value ?.mediaType === " video" );
4339const isAudio = computed (() => item .value ?.mediaType === " audio" );
@@ -50,9 +46,6 @@ const imageSrc = computed(() =>
5046 imageFailed .value ? thumbSrc .value : previewSrc .value ,
5147);
5248
53- // Waveform may fail to render (e.g. non-MP3 audio); fall back to the icon.
54- const waveformFailed = ref (false );
55-
5649const bigIcon = computed (() => {
5750 switch (item .value ?.mediaType ) {
5851 case " video" :
@@ -112,18 +105,7 @@ const lengthLabel = computed(() => {
112105 v-else-if =" isAudio"
113106 class =" bg-muted text-muted flex aspect-video w-full flex-col items-center justify-center gap-6 p-6"
114107 >
115- <img
116- v-if =" !waveformFailed"
117- :src =" waveformSrc"
118- alt =" "
119- class =" w-full max-w-2xl"
120- @error =" waveformFailed = true"
121- />
122- <UIcon
123- v-else
124- :name =" bigIcon "
125- class="size-14 opacity-40"
126- />
108+ <UIcon :name =" bigIcon " class="size-14 opacity-40" />
127109 <audio
128110 :src =" previewSrc"
129111 controls
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ const rangeTo = computed(() =>
9595 <UInput
9696 v-model =" query "
9797 icon="tabler:search "
98+ loading-icon="lucide:loader-circle "
9899 size="lg"
99100 :loading =" loading "
100101 :placeholder =" t (' vault.searchPlaceholder' )"
You can’t perform that action at this time.
0 commit comments