Add possibility to rip series disc with one title
This commit is contained in:
@ -15,7 +15,7 @@ RIPPED_DIR = "ripped"
|
||||
LOGFILE = "rip.log"
|
||||
NOTIFICATION_SOUND = "bell.oga"
|
||||
|
||||
SERIES_TITLE_REGEX = r"S\d+[ _]?E(\d+)-(\d+)$"
|
||||
SERIES_TITLE_REGEX = r"S\d+[ _]?E(\d+)(-(\d+))?$"
|
||||
MAX_FILENAME_LEN_IN_TMP = 25 # dvdbackup cuts name of output files at 33 chars
|
||||
WAIT_FOR_DEVICE_TIME_SECONDS = 3
|
||||
|
||||
@ -90,7 +90,12 @@ def is_series_title_valid(title):
|
||||
if episode_matches is None:
|
||||
return False
|
||||
episode_from = int(episode_matches.group(1))
|
||||
episode_to = int(episode_matches.group(2))
|
||||
episode_to = episode_matches.group(3)
|
||||
if episode_to:
|
||||
episode_to = int(episode_to)
|
||||
else:
|
||||
episode_to = episode_from
|
||||
|
||||
if episode_from < episode_to:
|
||||
return True
|
||||
except:
|
||||
@ -151,6 +156,7 @@ def rip_to_tmp_dir(args) -> bool:
|
||||
def create_info_command(args):
|
||||
return ["dvdbackup", "-i", args.dev, "-I"]
|
||||
|
||||
|
||||
def create_rip_command(args, dest):
|
||||
shortened_title = shorten_title(args)
|
||||
return [
|
||||
|
@ -23,7 +23,7 @@ OUT_VIDEO_FORMAT = os.environ["OUT_VIDEO_FORMAT"]
|
||||
MIN_EPISODES_DURATION_SECONDS = int(os.environ["MIN_EPISODES_DURATION_MINUTES"]) * 60
|
||||
MAX_EPISODES_DURATION_SECONDS = int(os.environ["MAX_EPISODES_DURATION_MINUTES"]) * 60
|
||||
|
||||
SERIES_TITLE_REGEX = r"S(\d+)[ _]?E(\d+)-(\d+)$"
|
||||
SERIES_TITLE_REGEX = r"S(\d+)[ _]?E(\d+)(-(\d+))?$"
|
||||
|
||||
|
||||
def main():
|
||||
@ -89,9 +89,13 @@ class Dvd:
|
||||
|
||||
series = int(re_matches.group(1))
|
||||
episode_from = int(re_matches.group(2))
|
||||
episode_to = int(re_matches.group(3))
|
||||
episode_to = re_matches.group(4)
|
||||
if episode_to:
|
||||
episode_to = int(episode_to)
|
||||
else:
|
||||
episode_to = episode_from
|
||||
|
||||
if episode_from >= episode_to:
|
||||
if episode_from > episode_to:
|
||||
return None
|
||||
|
||||
episodes = list(range(episode_from, episode_to + 1))
|
||||
|
Reference in New Issue
Block a user