diff --git a/transcoder/transcode_dvd.py b/transcoder/transcode_dvd.py index f8a1cf0..e6e94bd 100755 --- a/transcoder/transcode_dvd.py +++ b/transcoder/transcode_dvd.py @@ -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():