Skip to content

Commit 4ad6475

Browse files
christian-byrnegithub-actions
andauthored
[Feature] Add audio preview support to queue sidebar (#3954)
Co-authored-by: github-actions <[email protected]>
1 parent b531d34 commit 4ad6475

File tree

12 files changed

+121
-3
lines changed

12 files changed

+121
-3
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<audio controls width="100%" height="100%">
3+
<source :src="url" :type="htmlAudioType" />
4+
{{ $t('g.audioFailedToLoad') }}
5+
</audio>
6+
</template>
7+
8+
<script setup lang="ts">
9+
import { computed } from 'vue'
10+
11+
import { ResultItemImpl } from '@/stores/queueStore'
12+
13+
const { result } = defineProps<{
14+
result: ResultItemImpl
15+
}>()
16+
17+
const url = computed(() => result.url)
18+
const htmlAudioType = computed(() => result.htmlAudioType)
19+
</script>

src/components/sidebar/tabs/queue/ResultGallery.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
class="galleria-image"
3636
/>
3737
<ResultVideo v-else-if="item.isVideo" :result="item" />
38+
<ResultAudio v-else-if="item.isAudio" :result="item" />
3839
</template>
3940
</Galleria>
4041
</template>
@@ -46,6 +47,7 @@ import { onMounted, onUnmounted, ref, watch } from 'vue'
4647
import ComfyImage from '@/components/common/ComfyImage.vue'
4748
import { ResultItemImpl } from '@/stores/queueStore'
4849
50+
import ResultAudio from './ResultAudio.vue'
4951
import ResultVideo from './ResultVideo.vue'
5052
5153
const galleryVisible = ref(false)

src/components/sidebar/tabs/queue/ResultItem.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
:alt="result.filename"
1313
/>
1414
<ResultVideo v-else-if="result.isVideo" :result="result" />
15+
<ResultAudio v-else-if="result.isAudio" :result="result" />
1516
<div v-else class="task-result-preview">
1617
<i class="pi pi-file" />
1718
<span>{{ result.mediaType }}</span>
@@ -26,6 +27,7 @@ import ComfyImage from '@/components/common/ComfyImage.vue'
2627
import { ResultItemImpl } from '@/stores/queueStore'
2728
import { useSettingStore } from '@/stores/settingStore'
2829
30+
import ResultAudio from './ResultAudio.vue'
2931
import ResultVideo from './ResultVideo.vue'
3032
3133
const props = defineProps<{

src/locales/en/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"terminal": "Terminal",
1414
"logs": "Logs",
1515
"videoFailedToLoad": "Video failed to load",
16+
"audioFailedToLoad": "Audio failed to load",
1617
"extensionName": "Extension Name",
1718
"reloadToApplyChanges": "Reload to apply changes",
1819
"insert": "Insert",

src/locales/es/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"all": "Todo",
249249
"amount": "Cantidad",
250250
"apply": "Aplicar",
251+
"audioFailedToLoad": "No se pudo cargar el audio",
251252
"back": "Atrás",
252253
"cancel": "Cancelar",
253254
"capture": "captura",

src/locales/fr/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"all": "Tout",
249249
"amount": "Quantité",
250250
"apply": "Appliquer",
251+
"audioFailedToLoad": "Échec du chargement de l'audio",
251252
"back": "Retour",
252253
"cancel": "Annuler",
253254
"capture": "capture",

src/locales/ja/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"all": "すべて",
249249
"amount": "",
250250
"apply": "適用する",
251+
"audioFailedToLoad": "オーディオの読み込みに失敗しました",
251252
"back": "戻る",
252253
"cancel": "キャンセル",
253254
"capture": "キャプチャ",

src/locales/ko/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"all": "모두",
249249
"amount": "수량",
250250
"apply": "적용",
251+
"audioFailedToLoad": "오디오를 불러오지 못했습니다",
251252
"back": "뒤로",
252253
"cancel": "취소",
253254
"capture": "캡처",

src/locales/ru/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"all": "Все",
249249
"amount": "Количество",
250250
"apply": "Применить",
251+
"audioFailedToLoad": "Не удалось загрузить аудио",
251252
"back": "Назад",
252253
"cancel": "Отмена",
253254
"capture": "захват",

src/locales/zh/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
"all": "全部",
249249
"amount": "数量",
250250
"apply": "应用",
251+
"audioFailedToLoad": "音频加载失败",
251252
"back": "返回",
252253
"cancel": "取消",
253254
"capture": "捕获",

0 commit comments

Comments
 (0)