Skip to content

Commit

Permalink
Use tempfile.gettempdir() instead of hardcoding path
Browse files Browse the repository at this point in the history
  • Loading branch information
Hzqkii authored Feb 10, 2024
1 parent ff25cfd commit bc58478
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions target/jamba.vpy
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ from vapoursynth import core
import os
from os import path # filepath handling
import sys
import platform

user_os = platform.system()
import tempfile

path_dirname = path.dirname(__file__).replace('\\\\?\\', '') # .replace because windows

Expand Down Expand Up @@ -59,10 +57,8 @@ _, input_ext = path.splitext(input_video)

base_file_name = path.basename(input_video)

if user_os == "Linux":
temp_folder = "/tmp"
else:
temp_folder = os.environ['TEMP']

temp_folder = tempfile.gettempdir()
cache_file = path.join(temp_folder, f"{base_file_name}-ffms2_index")

if input_ext == '.avi':
Expand Down

0 comments on commit bc58478

Please sign in to comment.