fixed smart collection items

pull/264/head
meisnate12 4 years ago
parent 0c67bfb731
commit b751dfe6d8

@ -2,6 +2,7 @@ import glob, logging, os, requests
from modules import util from modules import util
from modules.meta import Metadata from modules.meta import Metadata
from modules.util import Failed from modules.util import Failed
import plexapi
from plexapi import utils from plexapi import utils
from plexapi.exceptions import BadRequest, NotFound, Unauthorized from plexapi.exceptions import BadRequest, NotFound, Unauthorized
from plexapi.collection import Collections from plexapi.collection import Collections
@ -638,7 +639,11 @@ class PlexAPI:
if smart_label_collection: if smart_label_collection:
return self.get_labeled_items(collection.title if isinstance(collection, Collections) else str(collection)) return self.get_labeled_items(collection.title if isinstance(collection, Collections) else str(collection))
elif isinstance(collection, Collections): elif isinstance(collection, Collections):
return self.query(collection.items) if self.smart(collection):
key = f"/library/sections/{self.Plex.key}/all{self.smart_filter(collection)}"
return self.Plex._search(key, None, 0, plexapi.X_PLEX_CONTAINER_SIZE)
else:
return self.query(collection.items)
else: else:
return [] return []

Loading…
Cancel
Save