added arr_folder collection detail #158

This commit is contained in:
meisnate12 2021-04-01 16:31:16 -04:00
parent 81071cfda0
commit 5ce3f3986a
3 changed files with 8 additions and 7 deletions

View file

@ -86,7 +86,7 @@ all_details = [
"collection_mode", "collection_order", "collection_mode", "collection_order",
"url_poster", "tmdb_poster", "tmdb_profile", "tvdb_poster", "file_poster", "url_poster", "tmdb_poster", "tmdb_profile", "tvdb_poster", "file_poster",
"url_background", "tmdb_background", "tvdb_background", "file_background", "url_background", "tmdb_background", "tvdb_background", "file_background",
"name_mapping", "add_to_arr", "arr_tag", "label", "name_mapping", "add_to_arr", "arr_tag", "arr_folder", "label",
"show_filtered", "show_missing", "save_missing" "show_filtered", "show_missing", "save_missing"
] ]
collectionless_details = [ collectionless_details = [
@ -153,6 +153,7 @@ class CollectionBuilder:
self.data = data self.data = data
self.details = { self.details = {
"arr_tag": None, "arr_tag": None,
"arr_folder": None,
"show_filtered": library.show_filtered, "show_filtered": library.show_filtered,
"show_missing": library.show_missing, "show_missing": library.show_missing,
"save_missing": library.save_missing "save_missing": library.save_missing
@ -1058,7 +1059,7 @@ class CollectionBuilder:
if self.details["save_missing"] is True: if self.details["save_missing"] is True:
self.library.add_missing(collection_name, missing_movies_with_names, True) self.library.add_missing(collection_name, missing_movies_with_names, True)
if self.do_arr and self.library.Radarr: if self.do_arr and self.library.Radarr:
self.library.Radarr.add_tmdb([missing_id for title, missing_id in missing_movies_with_names], tag=self.details["arr_tag"]) self.library.Radarr.add_tmdb([missing_id for title, missing_id in missing_movies_with_names], tag=self.details["arr_tag"], folder=self.details["arr_folder"])
if self.run_again: if self.run_again:
self.missing_movies.extend([missing_id for title, missing_id in missing_movies_with_names]) self.missing_movies.extend([missing_id for title, missing_id in missing_movies_with_names])
if len(missing_shows) > 0 and self.library.is_show: if len(missing_shows) > 0 and self.library.is_show:
@ -1087,7 +1088,7 @@ class CollectionBuilder:
if self.details["save_missing"] is True: if self.details["save_missing"] is True:
self.library.add_missing(collection_name, missing_shows_with_names, False) self.library.add_missing(collection_name, missing_shows_with_names, False)
if self.do_arr and self.library.Sonarr: if self.do_arr and self.library.Sonarr:
self.library.Sonarr.add_tvdb([missing_id for title, missing_id in missing_shows_with_names], tag=self.details["arr_tag"]) self.library.Sonarr.add_tvdb([missing_id for title, missing_id in missing_shows_with_names], tag=self.details["arr_tag"], folder=self.details["arr_folder"])
if self.run_again: if self.run_again:
self.missing_shows.extend([missing_id for title, missing_id in missing_shows_with_names]) self.missing_shows.extend([missing_id for title, missing_id in missing_shows_with_names])

View file

@ -37,7 +37,7 @@ class RadarrAPI:
self.search = params["search"] self.search = params["search"]
self.tag = params["tag"] self.tag = params["tag"]
def add_tmdb(self, tmdb_ids, tag=None): def add_tmdb(self, tmdb_ids, tag=None, folder=None):
logger.info("") logger.info("")
logger.debug(f"TMDb IDs: {tmdb_ids}") logger.debug(f"TMDb IDs: {tmdb_ids}")
tag_nums = [] tag_nums = []
@ -81,7 +81,7 @@ class RadarrAPI:
"tmdbid": int(tmdb_id), "tmdbid": int(tmdb_id),
"titleslug": titleslug, "titleslug": titleslug,
"monitored": True, "monitored": True,
"rootFolderPath": self.root_folder_path, "rootFolderPath": self.root_folder_path if folder is None else folder,
"images": [{"covertype": "poster", "url": poster}], "images": [{"covertype": "poster", "url": poster}],
"addOptions": {"searchForMovie": self.search} "addOptions": {"searchForMovie": self.search}
} }

View file

@ -39,7 +39,7 @@ class SonarrAPI:
self.season_folder = params["season_folder"] self.season_folder = params["season_folder"]
self.tag = params["tag"] self.tag = params["tag"]
def add_tvdb(self, tvdb_ids, tag=None): def add_tvdb(self, tvdb_ids, tag=None, folder=None):
logger.info("") logger.info("")
logger.debug(f"TVDb IDs: {tvdb_ids}") logger.debug(f"TVDb IDs: {tvdb_ids}")
tag_nums = [] tag_nums = []
@ -73,7 +73,7 @@ class SonarrAPI:
"language": self.language, "language": self.language,
"monitored": True, "monitored": True,
"seasonFolder": self.season_folder, "seasonFolder": self.season_folder,
"rootFolderPath": self.root_folder_path, "rootFolderPath": self.root_folder_path if folder is None else folder,
"seasons": [], "seasons": [],
"images": [{"covertype": "poster", "url": show.poster_path}], "images": [{"covertype": "poster", "url": show.poster_path}],
"addOptions": {"searchForMissingEpisodes": self.search} "addOptions": {"searchForMissingEpisodes": self.search}