diff --git a/modules/plex.py b/modules/plex.py index 84fe0842..e405266a 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -82,11 +82,6 @@ plex_languages = ["default", "ar-SA", "ca-ES", "cs-CZ", "da-DK", "de-DE", "el-GR metadata_language_options = {lang.lower(): lang for lang in plex_languages} metadata_language_options["default"] = None use_original_title_options = {"default": -1, "no": 0, "yes": 1} -collection_mode_options = { - "default": "default", "hide": "hide", - "hide_items": "hideItems", "hideitems": "hideItems", - "show_items": "showItems", "showitems": "showItems" -} collection_order_options = ["release", "alpha", "custom"] collection_level_options = ["episode", "season"] collection_mode_keys = {-1: "default", 0: "hide", 1: "hideItems", 2: "showItems"} diff --git a/modules/util.py b/modules/util.py index 90e4130a..8d8ff3b9 100644 --- a/modules/util.py +++ b/modules/util.py @@ -1,7 +1,6 @@ import glob, logging, os, re, signal, sys, time, traceback from datetime import datetime, timedelta from logging.handlers import RotatingFileHandler -from modules import plex from pathvalidate import is_valid_filename, sanitize_filename from plexapi.exceptions import BadRequest, NotFound, Unauthorized from plexapi.video import Season, Episode, Movie @@ -67,6 +66,11 @@ pretty_months = { } seasons = ["winter", "spring", "summer", "fall"] pretty_ids = {"anidbid": "AniDB", "imdbid": "IMDb", "mal_id": "MyAnimeList", "themoviedb_id": "TMDb", "thetvdb_id": "TVDb", "tvdbid": "TVDb"} +collection_mode_options = { + "default": "default", "hide": "hide", + "hide_items": "hideItems", "hideitems": "hideItems", + "show_items": "showItems", "showitems": "showItems" +} def tab_new_lines(data): return str(data).replace("\n", "\n|\t ") if "\n" in str(data) else str(data) @@ -349,8 +353,8 @@ def is_string_filter(values, modifier, data): return (jailbreak and modifier in [".not", ".isnot"]) or (not jailbreak and modifier in ["", ".is", ".begins", ".ends", ".regex"]) def check_collection_mode(collection_mode): - if collection_mode and str(collection_mode).lower() in plex.collection_mode_options: - return plex.collection_mode_options[str(collection_mode).lower()] + if collection_mode and str(collection_mode).lower() in collection_mode_options: + return collection_mode_options[str(collection_mode).lower()] else: raise Failed(f"Config Error: {collection_mode} collection_mode invalid\n\tdefault (Library default)\n\thide (Hide Collection)\n\thide_items (Hide Items in this Collection)\n\tshow_items (Show this Collection and its Items)")