Skip to content

Commit 92ef4ff

Browse files
committed
chore: undo ffmpeg waveform
1 parent 740e8e5 commit 92ef4ff

5 files changed

Lines changed: 4 additions & 297 deletions

File tree

backend/cmd/server/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

backend/cmd/server/vault_waveform.go

Lines changed: 0 additions & 265 deletions
This file was deleted.

frontend/app/components/vault/VaultCard.vue

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff 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-
5040
function onImgError() {
5141
if (imgStage.value === "thumbnail" && props.item.mediaType === "image") {
5242
imgStage.value = "preview";

frontend/app/pages/vault/[id].vue

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ const previewSrc = computed(
3434
const 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
4238
const isVideo = computed(() => item.value?.mediaType === "video");
4339
const 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-
5649
const 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

frontend/app/pages/vault/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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')"

0 commit comments

Comments
 (0)