From 65b424d3cc9e1da95add9c1e270cc17b269b2b20 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Sat, 19 Oct 2019 02:03:36 -0400 Subject: [PATCH] save a loop searchEpisodes --- fun/playlist_manager.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fun/playlist_manager.py b/fun/playlist_manager.py index d09d14b..1dd8575 100644 --- a/fun/playlist_manager.py +++ b/fun/playlist_manager.py @@ -330,10 +330,9 @@ def multi_filter_search(keyword_dict, library, search_eps=None): search_dict[key] = value if search_eps: logs["data"] = [{key: value}] - for show in library.all(): - for episode in show.episodes(**search_dict): - ep_lst += [episode.ratingKey] - ep_logs += [episode.title, episode.summary] + for episode in library.searchEpisodes(**search_dict): + ep_lst += [episode.ratingKey] + ep_logs += [episode.title, episode.summary] logs["data"].append({"keys": ep_lst, "info": ep_logs}) search_lst = ep_lst @@ -342,9 +341,8 @@ def multi_filter_search(keyword_dict, library, search_eps=None): multi_lst += search_lst else: if search_eps: - for show in library.all(): - for episode in show.episodes(**{key: values}): - ep_lst += [episode.ratingKey] + for episode in library.searchEpisodes(**{key: values}): + ep_lst += [episode.ratingKey] multi_lst += ep_lst else: