Skip to content

A self-hosted media server and file management system

fix: clicking custom fonts button starts job when you turn it off

aminnausin3ce8285a3698
diff --git a/resources/js/components/video/subtitles/PlayerSubtitles.vue b/resources/js/components/video/subtitles/PlayerSubtitles.vue
index 3e569a72..43321d6a 100644
--- a/resources/js/components/video/subtitles/PlayerSubtitles.vue
+++ b/resources/js/components/video/subtitles/PlayerSubtitles.vue
@@ -76,22 +76,19 @@ const playerSubtitleItems = computed(() => {
};
});
- const toggleFonts: PopoverItem | undefined =
- stateVideo.value.fonts?.length || !stateVideo.value.metadata?.fonts_scanned_at || stateVideo.value.metadata?.fonts_scanned_at === '...scanning'
- ? {
- icon: useFonts.value ? ProIconsTextHighlightColor : ProIconsTextHighlightColorOff,
- text: 'Custom Fonts',
- selected: useFonts.value,
- selectedIcon: ProiconsCheckmark,
- selectedIconStyle: 'text-primary',
- action: () => {
- useFonts.value = !useFonts.value;
- if (!stateVideo.value.metadata?.fonts_scanned_at && stateVideo.value.metadata?.id && items.length > 0) {
- runRegenerateFonts(stateVideo.value.id, stateVideo.value.metadata?.id);
- }
- },
- }
- : undefined;
+ const toggleFonts: PopoverItem = {
+ icon: useFonts.value ? ProIconsTextHighlightColor : ProIconsTextHighlightColorOff,
+ text: 'Custom Fonts',
+ selected: useFonts.value,
+ selectedIcon: ProiconsCheckmark,
+ selectedIconStyle: 'text-primary',
+ action: () => {
+ useFonts.value = !useFonts.value;
+ if (!stateVideo.value.metadata?.fonts_scanned_at && stateVideo.value.metadata?.id && items.length > 0 && useFonts.value) {
+ runRegenerateFonts(stateVideo.value.id, stateVideo.value.metadata?.id);
+ }
+ },
+ };
const subtitlesOff: PopoverItem = {
icon: IconCaptionsOff,