Fix bugs, script now working

This commit is contained in:
Julian Mutter 2022-08-29 15:53:37 +02:00
parent cd71ca64b4
commit e6917b9807

View File

@ -116,6 +116,8 @@ def chdir_to_script_dir():
def mkdirs():
os.makedirs(TMP_DIR, exist_ok=True)
os.makedirs(TRANSCODED_DIR, exist_ok=True)
os.makedirs(os.path.join(TRANSCODED_DIR, "movie"), exist_ok=True)
os.makedirs(os.path.join(TRANSCODED_DIR, "series"), exist_ok=True)
os.makedirs(RAW_DIR, exist_ok=True)
os.makedirs(os.path.join(RAW_DIR, "movie"), exist_ok=True)
os.makedirs(os.path.join(RAW_DIR, "series"), exist_ok=True)
@ -278,8 +280,9 @@ def find_series_titles(dvd: Dvd):
def mv_videos_from_tmp_to_transcoded_dir(video_files, video_type):
for video_file in video_files:
src = os.path.join(TMP_DIR, video_file)
dst = os.path.join(TRANSCODED_DIR, video_type)
src = video_file
file_name = os.path.basename(video_file)
dst = os.path.join(TRANSCODED_DIR, video_type, file_name)
shutil.move(src, dst)
@ -307,8 +310,8 @@ def delete_old_transcoding_logfile_if_exists(dvd: Dvd):
pass
def delete_original_video_files(folder):
shutil.rmtree(folder)
def delete_original_video_files(dvd: Dvd):
shutil.rmtree(dvd.dvd_path)
def delete_tmp_dir():