From 5b42fd225a511147b2f3ca035d1030d02c1a2410 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 18 May 2021 17:56:57 -0400 Subject: [PATCH] studio validation fix --- modules/builder.py | 8 +++----- modules/convert.py | 2 ++ plex_meta_manager.py | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/builder.py b/modules/builder.py index 4839dfeb..25142002 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -548,7 +548,7 @@ class CollectionBuilder: else: raise Failed("Collection Error: HDR must be true or false") else: - if smart in ["title", "episode_title"] and smart_mod in ["", ".not", ".begins", ".ends"]: + if smart in ["title", "episode_title", "studio"] and smart_mod in ["", ".not", ".begins", ".ends"]: results_list = [(t, t) for t in util.get_list(smart_data, split=False)] elif smart in plex.tags and smart_mod in ["", ".not", ".begins", ".ends"]: if smart_final in plex.tmdb_searches: @@ -559,8 +559,6 @@ class CollectionBuilder: smart_values.append(tmdb_name) else: smart_values.append(tmdb_value) - elif smart == "studio": - smart_values = util.get_list(smart_data, split=False) else: smart_values = util.get_list(smart_data) results_list = [] @@ -775,7 +773,7 @@ class CollectionBuilder: self.sonarr_options[method_name[7:]] = util.get_bool(method_name, method_data) elif method_name == "sonarr_tag": self.sonarr_options["tag"] = util.get_list(method_data) - elif method_name in ["title", "title.and", "title.not", "title.begins", "title.ends"]: + elif method_name in ["title", "title.and", "title.not", "title.begins", "studio.ends", "studio", "studio.and", "studio.not", "studio.begins", "studio.ends"]: self.methods.append(("plex_search", [{method_name: util.get_list(method_data, split=False)}])) elif method_name in ["year.gt", "year.gte", "year.lt", "year.lte"]: self.methods.append(("plex_search", [{method_name: util.check_year(method_data, current_year, method_name)}])) @@ -951,7 +949,7 @@ class CollectionBuilder: raise Failed(f"Collection Warning: plex search limit attribute: {search_data} must be an integer greater then 0") else: searches[search] = search_data - elif search == "title" and modifier in ["", ".and", ".not", ".begins", ".ends"]: + elif search in ["title", "studio"] and modifier in ["", ".and", ".not", ".begins", ".ends"]: searches[search_final] = util.get_list(search_data, split=False) elif search in plex.tags and modifier in ["", ".and", ".not", ".begins", ".ends"]: if search_final in plex.tmdb_searches: diff --git a/modules/convert.py b/modules/convert.py index 7eaa939b..0e5fe2c5 100644 --- a/modules/convert.py +++ b/modules/convert.py @@ -276,6 +276,8 @@ class Convert: except requests.exceptions.ConnectionError: util.print_stacktrace() raise Failed("No External GUIDs found") + if not tvdb_id and not imdb_id and not tmdb_id: + raise Failed("Refresh Metadata") elif item_type == "imdb": imdb_id = check_id elif item_type == "thetvdb": tvdb_id = int(check_id) elif item_type == "themoviedb": tmdb_id = int(check_id) diff --git a/plex_meta_manager.py b/plex_meta_manager.py index b80fe982..00d78d30 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -18,10 +18,10 @@ parser.add_argument("-t", "--time", dest="time", help="Time to update each day u parser.add_argument("-re", "--resume", dest="resume", help="Resume collection run from a specific collection", type=str) parser.add_argument("-r", "--run", dest="run", help="Run without the scheduler", action="store_true", default=False) parser.add_argument("-rt", "--test", "--tests", "--run-test", "--run-tests", dest="test", help="Run in debug mode with only collections that have test: true", action="store_true", default=False) -parser.add_argument("-lo", "--library-only", dest="library_only", help="Run only library operations", action="store_true", default=False) -parser.add_argument("-co", "--collection-only", dest="collection_only", help="Run only collection operations", action="store_true", default=False) -parser.add_argument("-cl", "--collection", "--collections", dest="collections", help="Process only specified collections (comma-separated list)", type=str) -parser.add_argument("-l", "--library", "--libraries", dest="libraries", help="Process only specified libraries (comma-separated list)", type=str) +parser.add_argument("-co", "--collection-only", "--collections-only", dest="collection_only", help="Run only collection operations", action="store_true", default=False) +parser.add_argument("-lo", "--library-only", "--libraries-only", dest="library_only", help="Run only library operations", action="store_true", default=False) +parser.add_argument("-rc", "-cl", "--collection", "--collections", "--run-collection", "--run-collections", dest="collections", help="Process only specified collections (comma-separated list)", type=str) +parser.add_argument("-rl", "-l", "--library", "--libraries", "--run-library", "--run-libraries", dest="libraries", help="Process only specified libraries (comma-separated list)", type=str) parser.add_argument("-d", "--divider", dest="divider", help="Character that divides the sections (Default: '=')", default="=", type=str) parser.add_argument("-w", "--width", dest="width", help="Screen Width (Default: 100)", default=100, type=int) args = parser.parse_args() @@ -41,8 +41,8 @@ def check_bool(env_str, default): test = check_bool("PMM_TEST", args.test) debug = check_bool("PMM_DEBUG", args.debug) run = check_bool("PMM_RUN", args.run) -library_only = check_bool("PMM_LIBRARY_ONLY", args.library_only) -collection_only = check_bool("PMM_COLLECTION_ONLY", args.collection_only) +library_only = check_bool("PMM_LIBRARIES_ONLY", args.library_only) +collection_only = check_bool("PMM_COLLECTIONS_ONLY", args.collection_only) collections = os.environ.get("PMM_COLLECTIONS") if os.environ.get("PMM_COLLECTIONS") else args.collections libraries = os.environ.get("PMM_LIBRARIES") if os.environ.get("PMM_LIBRARIES") else args.libraries resume = os.environ.get("PMM_RESUME") if os.environ.get("PMM_RESUME") else args.resume @@ -156,7 +156,7 @@ def update_libraries(config, is_test, requested_collections, resume_from): unmanaged_count += 1 logger.info("{} Unmanaged Collections".format(unmanaged_count)) - if library.assets_for_all is True and not is_test and not requested_collections: + if library.assets_for_all is True and not is_test and not requested_collections and not collection_only: logger.info("") util.separator(f"All {'Movies' if library.is_movie else 'Shows'} Assets Check for {library.name} Library") logger.info("")