From bb5e0d4d359213fdbf7b7c1cdb206c49855727db Mon Sep 17 00:00:00 2001 From: Vic Wong Date: Thu, 2 Jan 2025 19:57:15 -0800 Subject: [PATCH] fix: media file path incorrect on windows --- pikaraoke/app.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pikaraoke/app.py b/pikaraoke/app.py index ab8d14d5..01e318bf 100644 --- a/pikaraoke/app.py +++ b/pikaraoke/app.py @@ -801,11 +801,9 @@ def clear_preferences(): # Streams the file in chunks from the filesystem (chrome supports it, safari does not) - - @app.route("/stream/") def stream(id): - file_path = f"{get_tmp_dir()}/{id}.mp4" + file_path = os.path.join(get_tmp_dir(), f"{id}.mp4") def generate(): position = 0 # Initialize the position variable @@ -830,7 +828,7 @@ def generate(): # (Safari compatible, but requires the ffmpeg transcoding to be complete to know file size) @app.route("/stream/full/") def stream_full(id): - file_path = f"{get_tmp_dir()}/{id}.mp4" + file_path = os.path.join(get_tmp_dir(), f"{id}.mp4") try: file_size = os.path.getsize(file_path) range_header = request.headers.get("Range", None)