Fix video previews not displayed if VHS previously installed but disabled or uninstalled (#3844)

This commit is contained in:
Christian Byrne
2025-05-10 13:03:55 -07:00
committed by GitHub
parent 6ed870d431
commit 974236ce5a
3 changed files with 15 additions and 4 deletions

View File

@@ -8,6 +8,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useExtensionStore } from '@/stores/extensionStore'
import { ResultItemImpl } from '@/stores/queueStore'
import { useSettingStore } from '@/stores/settingStore'
@@ -16,9 +17,16 @@ const props = defineProps<{
}>()
const settingStore = useSettingStore()
const vhsAdvancedPreviews = computed(() =>
settingStore.get('VHS.AdvancedPreviews')
)
const { isExtensionInstalled, isExtensionEnabled } = useExtensionStore()
const vhsAdvancedPreviews = computed(() => {
return (
isExtensionInstalled('VideoHelperSuite.Core') &&
isExtensionEnabled('VideoHelperSuite.Core') &&
settingStore.get('VHS.AdvancedPreviews') &&
settingStore.get('VHS.AdvancedPreviews') !== 'Never'
)
})
const url = computed(() =>
vhsAdvancedPreviews.value

View File

@@ -451,7 +451,7 @@ const zSettings = z.object({
'Comfy.Load3D.CameraType': z.enum(['perspective', 'orthographic']),
'pysssss.SnapToGrid': z.boolean(),
/** VHS setting is used for queue video preview support. */
'VHS.AdvancedPreviews': z.boolean(),
'VHS.AdvancedPreviews': z.string(),
/** Settings used for testing */
'test.setting': z.any(),
'main.sub.setting.name': z.any(),

View File

@@ -36,6 +36,8 @@ export const useExtensionStore = defineStore('extension', () => {
)
})
const isExtensionInstalled = (name: string) => name in extensionByName.value
const isExtensionEnabled = (name: string) =>
!disabledExtensionNames.value.has(name)
const enabledExtensions = computed(() => {
@@ -96,6 +98,7 @@ export const useExtensionStore = defineStore('extension', () => {
extensions,
enabledExtensions,
inactiveDisabledExtensionNames,
isExtensionInstalled,
isExtensionEnabled,
isExtensionReadOnly,
registerExtension,