From c67c9912cc07fc8a7b99bc728d5368fc3d41d26d Mon Sep 17 00:00:00 2001 From: arabcoders Date: Thu, 5 Feb 2026 16:18:32 +0300 Subject: [PATCH] fix: show alert instead of notification for missing video file. --- pyproject.toml | 1 + ui/app/components/History.vue | 2 +- ui/app/components/VideoPlayer.vue | 13 +++++++------ uv.lock | 11 +++++++++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cf4c044d..1a78fbdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -201,4 +201,5 @@ dev = [ "pytest>=8.4.2", "pytest-asyncio>=1.1.0", "ruff>=0.13.0", + "pip>=26.0.0", ] diff --git a/ui/app/components/History.vue b/ui/app/components/History.vue index f6262bcb..dc4e5883 100644 --- a/ui/app/components/History.vue +++ b/ui/app/components/History.vue @@ -474,7 +474,7 @@ diff --git a/ui/app/components/VideoPlayer.vue b/ui/app/components/VideoPlayer.vue index 7b7a704b..b30241ad 100644 --- a/ui/app/components/VideoPlayer.vue +++ b/ui/app/components/VideoPlayer.vue @@ -260,11 +260,12 @@ import type { StoreItem } from '~/types/store' import type { file_info, video_source_element, video_track_element } from '~/types/video' const config = useConfigStore() -const toast = useNotification() -const props = defineProps({ item: { type: Object as () => StoreItem, default: () => ({}) } }) - -const emitter = defineEmits(['closeModel']) +const props = defineProps<{ item: StoreItem }>() +const emitter = defineEmits<{ + (e: 'closeModel'): void, + (e: 'error', message: string): void, +}>() const video = useTemplateRef('video') const tracks = ref>([]) @@ -486,7 +487,7 @@ onMounted(async () => { const response: file_info = await req.json() if (!req.ok) { - toast.error(`Failed to fetch video info. ${response?.error}`) + emitter('error', response?.error || 'Failed to fetch video info. Unknown error') emitter('closeModel') return } @@ -746,7 +747,7 @@ const forceSwitchToHls = () => { } if (!hasVideoStream.value) { - toast.error('Cannot switch to HLS: stream has no video track.') + useNotification().error('Cannot switch to HLS: stream has no video track.') return } diff --git a/uv.lock b/uv.lock index 005a1b6f..cc3d8b52 100644 --- a/uv.lock +++ b/uv.lock @@ -928,6 +928,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/54/16/12b82f791c7f50ddec566873d5bdd245baa1491bac11d15ffb98aecc8f8b/pefile-2024.8.26-py3-none-any.whl", hash = "sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f", size = 74766 }, ] +[[package]] +name = "pip" +version = "26.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/48/83/0d7d4e9efe3344b8e2fe25d93be44f64b65364d3c8d7bc6dc90198d5422e/pip-26.0.1.tar.gz", hash = "sha256:c4037d8a277c89b320abe636d59f91e6d0922d08a05b60e85e53b296613346d8", size = 1812747 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/f0/c81e05b613866b76d2d1066490adf1a3dbc4ee9d9c839961c3fc8a6997af/pip-26.0.1-py3-none-any.whl", hash = "sha256:bdb1b08f4274833d62c1aa29e20907365a2ceb950410df15fc9521bad440122b", size = 1787723 }, +] + [[package]] name = "platformdirs" version = "4.5.1" @@ -2069,6 +2078,7 @@ installer = [ [package.dev-dependencies] dev = [ { name = "debugpy" }, + { name = "pip" }, { name = "pytest" }, { name = "pytest-asyncio" }, { name = "ruff" }, @@ -2118,6 +2128,7 @@ provides-extras = ["installer"] [package.metadata.requires-dev] dev = [ { name = "debugpy", specifier = ">=1.8.16" }, + { name = "pip", specifier = ">=26.0.0" }, { name = "pytest", specifier = ">=8.4.2" }, { name = "pytest-asyncio", specifier = ">=1.1.0" }, { name = "ruff", specifier = ">=0.13.0" },