[22] fix None Operations Error

pull/847/head
meisnate12 3 years ago
parent dd533ef007
commit eb063b4885

@ -1 +1 @@
1.16.4
1.16.3-develop22

@ -2121,6 +2121,19 @@ class CollectionBuilder:
return False
elif modifier in [".gt", ".gte", ".lt", ".lte", ".count_gt", ".count_gte", ".count_lt", ".count_lte"]:
divider = 60000 if filter_attr == "duration" else 1
test_number = []
if filter_attr == "resolution":
for media in item.media:
test_number.append(media.videoResolution)
elif filter_attr == "audio_language":
for media in item.media:
for part in media.parts:
test_number.extend([a.language for a in part.audioStreams()])
elif filter_attr == "subtitle_language":
for media in item.media:
for part in media.parts:
test_number.extend([s.language for s in part.subtitleStreams()])
else:
test_number = getattr(item, filter_actual)
if modifier in [".count_gt", ".count_gte", ".count_lt", ".count_lte"]:
test_number = len(test_number) if test_number else 0

@ -3,6 +3,7 @@ from abc import ABC, abstractmethod
from modules import util
from modules.meta import MetadataFile
from modules.util import Failed
from modules.operations import Operations
from PIL import Image
from plexapi.exceptions import BadRequest
from ruamel import yaml
@ -15,7 +16,7 @@ class Library(ABC):
self.Sonarr = None
self.Tautulli = None
self.Webhooks = None
self.Operations = None
self.Operations = Operations(config, self)
self.Notifiarr = None
self.collections = []
self.metadatas = []

@ -211,8 +211,11 @@ def update_libraries(config):
logger.info("")
logger.separator(f"{library.name} Library")
if config.library_first and library.library_operation and not config.test_mode and not collection_only:
if config.library_first and not config.test_mode and not collection_only:
if not overlay_only and library.library_operation:
library.Operations.run_operations()
if not library_only and library.overlay_files:
library.Overlays.run_overlays()
logger.debug("")
logger.debug(f"Mapping Name: {library.original_mapping_name}")
@ -278,8 +281,11 @@ def update_libraries(config):
run_collection(config, library, metadata, collections_to_run)
logger.re_add_library_handler(library.mapping_name)
if not config.library_first and library.library_operation and not config.test_mode and not collection_only:
if not config.library_first and not config.test_mode and not collection_only:
if not overlay_only and library.library_operation:
library.Operations.run_operations()
if not library_only and library.overlay_files:
library.Overlays.run_overlays()
logger.remove_library_handler(library.mapping_name)
except Exception as e:

Loading…
Cancel
Save