Fix bugs, Add error messages
This commit is contained in:
@ -27,6 +27,13 @@ def main():
|
||||
chdir_to_script_dir()
|
||||
mkdirs()
|
||||
|
||||
dst = os.path.join(RIPPED_DIR, args.type, args.title)
|
||||
if os.path.exists(dst):
|
||||
print(
|
||||
f"A {args.type} with this name has already been ripped. Are you sure you spelled the name right?"
|
||||
)
|
||||
exit(1)
|
||||
|
||||
success = rip_to_tmp_dir(args)
|
||||
program_execution_time_str = get_program_execution_time_str(program_start_time)
|
||||
if success:
|
||||
@ -110,14 +117,11 @@ def rip_to_tmp_dir(args) -> bool:
|
||||
|
||||
|
||||
def create_rip_command(args, dest):
|
||||
if args.type == "movie":
|
||||
return f"dvdbackup -i '{args.dev}' -o '{dest}' -F -n '{args.title}'"
|
||||
else:
|
||||
return f"dvdbackup -i '{args.dev}' -o '{dest}' -M -n '{args.title}'"
|
||||
return f"dvdbackup -v -p -i '{args.dev}' -o '{dest}' -M -n \"{args.title}\""
|
||||
|
||||
|
||||
def get_program_execution_time_str(program_start_time):
|
||||
program_execution_time_minutes = (program_start_time - time.time()) / 60.0
|
||||
program_execution_time_minutes = (time.time() - program_start_time) / 60.0
|
||||
program_execution_time_minutes = max(0.0, program_execution_time_minutes)
|
||||
return f"{program_execution_time_minutes:.1f} minutes"
|
||||
|
||||
|
Reference in New Issue
Block a user