Fix bugs due to Dvd now being a class

This commit is contained in:
Julian Mutter 2022-08-27 20:26:28 +02:00
parent 13e5f4fbe6
commit 58f2c3295a

View File

@ -136,11 +136,13 @@ def list_ripped_dvds(dvd_type):
exit(1) exit(1)
def is_dvd_files_not_locked(dvd): def is_dvd_files_not_locked(dvd: Dvd):
return not os.path.exists(dvd + ".lock") and not os.path.exists(dvd + ".err.log") return not os.path.exists(dvd.dvd_path + ".lock") and not os.path.exists(
dvd.dvd_path + ".err.log"
)
def transcode_ripped_dvd(dvd): def transcode_ripped_dvd(dvd: Dvd):
if dvd.is_movie(): if dvd.is_movie():
return transcode_movie(dvd) return transcode_movie(dvd)
else: else:
@ -206,7 +208,7 @@ def transcode_series(dvd: Dvd):
dvd.transcode_command_args_without_title_number(output_file) dvd.transcode_command_args_without_title_number(output_file)
+ [ + [
"--title", "--title",
title_number, str(title_number),
"--min-duration", "--min-duration",
str(MIN_EPISODES_DURATION_SECONDS), str(MIN_EPISODES_DURATION_SECONDS),
], ],
@ -277,12 +279,19 @@ def write_to_logfile(dvd: Dvd, tag):
file.write(log_line + "\n") file.write(log_line + "\n")
def delete_transcoding_logfile(dvd): def delete_transcoding_logfile(dvd: Dvd):
os.remove(dvd + ".log") os.remove(dvd.log_file)
def rename_transcoding_logfile_as_error_log(dvd): def rename_transcoding_logfile_as_error_log(dvd: Dvd):
shutil.move(dvd + ".log", dvd + ".err.log") shutil.move(dvd.log_file, dvd.err_log_file)
def delete_old_transcoding_logfile_if_exists(dvd: Dvd):
try:
os.remove(dvd.log_file)
except FileNotFoundError:
pass
def delete_original_video_files(folder): def delete_original_video_files(folder):