[36] prep for batch edits

pull/1750/head
meisnate12 6 months ago
parent 6472d79386
commit 1c3a02b75e

@ -1 +1 @@
1.19.1-develop35
1.19.1-develop36

@ -33,7 +33,7 @@ playlist_files:
libraries: Movies, TV Shows # list of libraries that you want the PMM Defaults playlists to look at
# see the wiki for how to use local files, folders, URLs, or files from git
settings:
run_order: metadata, overlays, operations
run_order: operations, metadata, overlays
cache: true
cache_expiration: 60
asset_directory: config/assets

@ -110,7 +110,7 @@ library_operations = {
"mass_critic_rating_update": mass_rating_options, "mass_episode_critic_rating_update": mass_episode_rating_options,
"mass_user_rating_update": mass_rating_options, "mass_episode_user_rating_update": mass_episode_rating_options,
"mass_original_title_update": mass_original_title_options, "mass_originally_available_update": mass_available_options,
"mass_imdb_parental_labels": imdb_label_options, "mass_episode_imdb_parental_labels": imdb_label_options,
"mass_imdb_parental_labels": imdb_label_options,
"mass_collection_mode": "mass_collection_mode", "mass_poster_update": "dict", "mass_background_update": "dict",
"metadata_backup": "dict", "delete_collections": "dict", "genre_mapper": "dict", "content_rating_mapper": "dict",
}
@ -812,7 +812,9 @@ class ConfigFile:
if "mapper" in op:
params[op] = input_dict
for old_value, new_value in input_dict.items():
if old_value == new_value:
if not old_value:
logger.warning("Config Warning: The key cannot be empty")
elif old_value == new_value:
logger.warning(f"Config Warning: {op} value '{new_value}' ignored as it cannot be mapped to itself")
else:
params[op][old_value] = new_value if new_value else None

@ -94,7 +94,6 @@ class Library(ABC):
self.mass_original_title_update = params["mass_original_title_update"]
self.mass_originally_available_update = params["mass_originally_available_update"]
self.mass_imdb_parental_labels = params["mass_imdb_parental_labels"]
self.mass_episode_imdb_parental_labels = params["mass_episode_imdb_parental_labels"]
self.mass_poster_update = params["mass_poster_update"]
self.mass_background_update = params["mass_background_update"]
self.radarr_add_all_existing = params["radarr_add_all_existing"]
@ -122,13 +121,13 @@ class Library(ABC):
or self.mass_audience_rating_update or self.mass_critic_rating_update or self.mass_user_rating_update \
or self.mass_episode_audience_rating_update or self.mass_episode_critic_rating_update or self.mass_episode_user_rating_update \
or self.mass_content_rating_update or self.mass_originally_available_update or self.mass_original_title_update\
or self.mass_imdb_parental_labels or self.mass_episode_imdb_parental_labels or self.genre_mapper or self.content_rating_mapper or self.mass_studio_update\
or self.mass_imdb_parental_labels or self.genre_mapper or self.content_rating_mapper or self.mass_studio_update\
or self.radarr_add_all_existing or self.sonarr_add_all_existing or self.mass_poster_update or self.mass_background_update else False
self.library_operation = True if self.items_library_operation or self.delete_collections or self.mass_collection_mode \
or self.radarr_remove_by_tag or self.sonarr_remove_by_tag or self.show_unmanaged or self.show_unconfigured \
or self.metadata_backup or self.update_blank_track_titles else False
self.meta_operations = [i["source"] if isinstance(i, dict) else i for i in [getattr(self, o) for o in operations.meta_operations] if i]
self.label_operations = True if self.assets_for_all or self.mass_imdb_parental_labels or self.mass_episode_imdb_parental_labels else False
self.label_operations = True if self.assets_for_all or self.mass_imdb_parental_labels else False
if self.asset_directory:
logger.info("")

@ -38,7 +38,6 @@ class Operations:
logger.debug(f"Mass Original Title Update: {self.library.mass_original_title_update}")
logger.debug(f"Mass Originally Available Update: {self.library.mass_originally_available_update}")
logger.debug(f"Mass IMDb Parental Labels: {self.library.mass_imdb_parental_labels}")
logger.debug(f"Mass Episode IMDb Parental Labels: {self.library.mass_episode_imdb_parental_labels}")
logger.debug(f"Mass Poster Update: {self.library.mass_poster_update}")
logger.debug(f"Mass Background Update: {self.library.mass_background_update}")
logger.debug(f"Mass Collection Mode Update: {self.library.mass_collection_mode}")

@ -732,6 +732,19 @@ class Plex(Library):
item._autoReload = False
return item
def load_from_cache(self, rating_key):
if rating_key in self.cached_items:
item, _ = self.cached_items[rating_key]
return item
def load_list_from_cache(self, rating_keys):
item_list = []
for rating_key in rating_keys:
item = self.load_from_cache(rating_key)
if item:
item_list.append(item)
return item_list
@retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex)
def reload(self, item, force=False):
is_full = False

Loading…
Cancel
Save