Skip to content

Commit

Permalink
fix: media file path incorrect on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vicwomg committed Jan 3, 2025
1 parent f4140a5 commit 4a38710
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pikaraoke/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,11 +801,9 @@ def clear_preferences():


# Streams the file in chunks from the filesystem (chrome supports it, safari does not)


@app.route("/stream/<id>")
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
Expand All @@ -830,7 +828,7 @@ def generate():
# (Safari compatible, but requires the ffmpeg transcoding to be complete to know file size)
@app.route("/stream/full/<id>")
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)
Expand Down

0 comments on commit 4a38710

Please sign in to comment.