|
|
@ -296,7 +296,7 @@ class CollectionBuilder:
|
|
|
|
if run_time.startswith("hour"):
|
|
|
|
if run_time.startswith("hour"):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
if 0 <= int(param) <= 23:
|
|
|
|
if 0 <= int(param) <= 23:
|
|
|
|
self.schedule += f"\nScheduled to run only on the {util.make_ordinal(param)} hour"
|
|
|
|
self.schedule += f"\nScheduled to run only on the {util.make_ordinal(int(param))} hour"
|
|
|
|
if self.config.run_hour == int(param):
|
|
|
|
if self.config.run_hour == int(param):
|
|
|
|
skip_collection = False
|
|
|
|
skip_collection = False
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -314,7 +314,7 @@ class CollectionBuilder:
|
|
|
|
elif run_time.startswith("month"):
|
|
|
|
elif run_time.startswith("month"):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
if 1 <= int(param) <= 31:
|
|
|
|
if 1 <= int(param) <= 31:
|
|
|
|
self.schedule += f"\nScheduled monthly on the {util.make_ordinal(param)}"
|
|
|
|
self.schedule += f"\nScheduled monthly on the {util.make_ordinal(int(param))}"
|
|
|
|
if self.current_time.day == int(param) or (self.current_time.day == last_day.day and int(param) > last_day.day):
|
|
|
|
if self.current_time.day == int(param) or (self.current_time.day == last_day.day and int(param) > last_day.day):
|
|
|
|
skip_collection = False
|
|
|
|
skip_collection = False
|
|
|
|
else:
|
|
|
|
else:
|
|
|
@ -349,7 +349,7 @@ class CollectionBuilder:
|
|
|
|
logger.warning(f"Collection Warning: run_again attribute is blank defaulting to false")
|
|
|
|
logger.warning(f"Collection Warning: run_again attribute is blank defaulting to false")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
logger.debug(f"Value: {self.data[methods['run_again']]}")
|
|
|
|
logger.debug(f"Value: {self.data[methods['run_again']]}")
|
|
|
|
self.run_again = util.get_bool("run_again", self.data[methods["run_again"]])
|
|
|
|
self.run_again = util.parse_bool("run_again", self.data[methods["run_again"]])
|
|
|
|
|
|
|
|
|
|
|
|
self.sync = self.library.sync_mode == "sync"
|
|
|
|
self.sync = self.library.sync_mode == "sync"
|
|
|
|
if "sync_mode" in methods:
|
|
|
|
if "sync_mode" in methods:
|
|
|
@ -372,7 +372,7 @@ class CollectionBuilder:
|
|
|
|
logger.warning(f"Collection Warning: build_collection attribute is blank defaulting to true")
|
|
|
|
logger.warning(f"Collection Warning: build_collection attribute is blank defaulting to true")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
logger.debug(f"Value: {self.data[methods['build_collection']]}")
|
|
|
|
logger.debug(f"Value: {self.data[methods['build_collection']]}")
|
|
|
|
self.build_collection = util.get_bool("build_collection", self.data[methods["build_collection"]])
|
|
|
|
self.build_collection = util.parse_bool("build_collection", self.data[methods["build_collection"]])
|
|
|
|
|
|
|
|
|
|
|
|
if "tmdb_person" in methods:
|
|
|
|
if "tmdb_person" in methods:
|
|
|
|
logger.info("")
|
|
|
|
logger.info("")
|
|
|
@ -596,7 +596,7 @@ class CollectionBuilder:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.details[method_final] = util.get_list(method_data)
|
|
|
|
self.details[method_final] = util.get_list(method_data)
|
|
|
|
elif method_name in boolean_details:
|
|
|
|
elif method_name in boolean_details:
|
|
|
|
self.details[method_name] = util.get_bool(method_name, method_data)
|
|
|
|
self.details[method_name] = util.parse_bool(method_name, method_data)
|
|
|
|
elif method_name in string_details:
|
|
|
|
elif method_name in string_details:
|
|
|
|
self.details[method_name] = str(method_data)
|
|
|
|
self.details[method_name] = str(method_data)
|
|
|
|
|
|
|
|
|
|
|
@ -638,11 +638,11 @@ class CollectionBuilder:
|
|
|
|
|
|
|
|
|
|
|
|
def _radarr(self, method_name, method_data):
|
|
|
|
def _radarr(self, method_name, method_data):
|
|
|
|
if method_name == "radarr_add":
|
|
|
|
if method_name == "radarr_add":
|
|
|
|
self.add_to_radarr = util.get_bool(method_name, method_data)
|
|
|
|
self.add_to_radarr = util.parse_bool(method_name, method_data)
|
|
|
|
elif method_name == "radarr_folder":
|
|
|
|
elif method_name == "radarr_folder":
|
|
|
|
self.radarr_options["folder"] = method_data
|
|
|
|
self.radarr_options["folder"] = method_data
|
|
|
|
elif method_name in ["radarr_monitor", "radarr_search"]:
|
|
|
|
elif method_name in ["radarr_monitor", "radarr_search"]:
|
|
|
|
self.radarr_options[method_name[7:]] = util.get_bool(method_name, method_data)
|
|
|
|
self.radarr_options[method_name[7:]] = util.parse_bool(method_name, method_data)
|
|
|
|
elif method_name == "radarr_availability":
|
|
|
|
elif method_name == "radarr_availability":
|
|
|
|
if str(method_data).lower() in radarr.availability_translation:
|
|
|
|
if str(method_data).lower() in radarr.availability_translation:
|
|
|
|
self.radarr_options["availability"] = str(method_data).lower()
|
|
|
|
self.radarr_options["availability"] = str(method_data).lower()
|
|
|
@ -656,7 +656,7 @@ class CollectionBuilder:
|
|
|
|
|
|
|
|
|
|
|
|
def _sonarr(self, method_name, method_data):
|
|
|
|
def _sonarr(self, method_name, method_data):
|
|
|
|
if method_name == "sonarr_add":
|
|
|
|
if method_name == "sonarr_add":
|
|
|
|
self.add_to_sonarr = util.get_bool(method_name, method_data)
|
|
|
|
self.add_to_sonarr = util.parse_bool(method_name, method_data)
|
|
|
|
elif method_name == "sonarr_folder":
|
|
|
|
elif method_name == "sonarr_folder":
|
|
|
|
self.sonarr_options["folder"] = method_data
|
|
|
|
self.sonarr_options["folder"] = method_data
|
|
|
|
elif method_name == "sonarr_monitor":
|
|
|
|
elif method_name == "sonarr_monitor":
|
|
|
@ -676,7 +676,7 @@ class CollectionBuilder:
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise Failed(f"Collection Error: {method_name} attribute must be either standard, daily, or anime")
|
|
|
|
raise Failed(f"Collection Error: {method_name} attribute must be either standard, daily, or anime")
|
|
|
|
elif method_name in ["sonarr_season", "sonarr_search", "sonarr_cutoff_search"]:
|
|
|
|
elif method_name in ["sonarr_season", "sonarr_search", "sonarr_cutoff_search"]:
|
|
|
|
self.sonarr_options[method_name[7:]] = util.get_bool(method_name, method_data)
|
|
|
|
self.sonarr_options[method_name[7:]] = util.parse_bool(method_name, method_data)
|
|
|
|
elif method_name == "sonarr_tag":
|
|
|
|
elif method_name == "sonarr_tag":
|
|
|
|
self.sonarr_options["tag"] = util.get_list(method_data)
|
|
|
|
self.sonarr_options["tag"] = util.get_list(method_data)
|
|
|
|
|
|
|
|
|
|
|
@ -1231,7 +1231,7 @@ class CollectionBuilder:
|
|
|
|
elif attribute in ["decade", "year", "episode_year"] and modifier in ["", ".not"]:
|
|
|
|
elif attribute in ["decade", "year", "episode_year"] and modifier in ["", ".not"]:
|
|
|
|
return smart_pair(util.get_year_list(data, self.current_year, final))
|
|
|
|
return smart_pair(util.get_year_list(data, self.current_year, final))
|
|
|
|
elif attribute in plex.boolean_attributes:
|
|
|
|
elif attribute in plex.boolean_attributes:
|
|
|
|
return util.get_bool(attribute, data)
|
|
|
|
return util.parse_bool(attribute, data)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise Failed(f"Collection Error: {final} attribute not supported")
|
|
|
|
raise Failed(f"Collection Error: {final} attribute not supported")
|
|
|
|
|
|
|
|
|
|
|
|