Ceil len of names in tmp

This is because dvdbackup allows maximum 33 chars in the output file (I
dont know why)
This commit is contained in:
2022-09-14 17:32:26 +02:00
parent d48b5d7bb5
commit 0359171483

@ -16,6 +16,7 @@ LOGFILE = "rip.log"
NOTIFICATION_SOUND = "bell.oga"
SERIES_TITLE_REGEX = r"S\d+[ _]?E(\d+)-(\d+)$"
MAX_FILENAME_LEN_IN_TMP = 30 # dvdbackup cuts name of output files at 33 chars
def main():
@ -117,7 +118,8 @@ def rip_to_tmp_dir(args) -> bool:
def create_rip_command(args, dest):
return f"dvdbackup -v -p -i '{args.dev}' -o '{dest}' -M -n \"{args.title}\""
shortened_title = args.title[:MAX_FILENAME_LEN_IN_TMP]
return f"dvdbackup -v -p -i '{args.dev}' -o '{dest}' -M -n {shortened_title}"
def get_program_execution_time_str(program_start_time):
@ -150,7 +152,8 @@ def send_notification(text):
def mv_ripped_from_tmp_to_ripped_dir(args):
src = os.path.join(TMP_DIR, args.title)
shortened_title = args.title[:MAX_FILENAME_LEN_IN_TMP]
src = os.path.join(TMP_DIR, shortened_title)
dst = os.path.join(RIPPED_DIR, args.type, args.title)
shutil.move(src, dst)