From 1100db8bf0c45a33a918e24c48484240901e3c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= <mordae@anilinux.org> Date: Sun, 9 Mar 2025 18:07:06 +0100 Subject: [PATCH] Escape file path properly --- lazy_player/video_player.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lazy_player/video_player.py b/lazy_player/video_player.py index e0e8502..f66eaf7 100644 --- a/lazy_player/video_player.py +++ b/lazy_player/video_player.py @@ -1,6 +1,5 @@ from __future__ import annotations -import os from pathlib import Path import gi @@ -45,10 +44,7 @@ class VideoPlayer(GObject.Object): def play(self, file_path: Path | str, position: int = 0, subtitle_track: int = -2) -> None: """Start playing a video file""" - if isinstance(file_path, Path): - file_path = os.path.abspath(file_path) - - self.playbin.set_property("uri", f"file://{file_path}") + self.playbin.set_property("uri", Gst.filename_to_uri(str(file_path))) if subtitle_track >= 0: flags = self.playbin.get_property("flags")