Generators

For episodes
This commit is contained in:
angelblue05 2018-03-13 18:54:14 -05:00
parent 4cd270a9d2
commit 7ded39d580

View file

@ -6,6 +6,7 @@ import logging
from ntpath import dirname from ntpath import dirname
import api import api
import emby as mb
import embydb_functions as embydb import embydb_functions as embydb
import _kodi_tvshows import _kodi_tvshows
from _common import Items, catch_except from _common import Items, catch_except
@ -202,7 +203,7 @@ class TVShows(Items):
for item in self.added(items, total): for item in self.added(items, total):
if self.add_update(item, view): if self.add_update(item, view):
# Add episodes # Add episodes
all_episodes = self.emby.getEpisodesbyShow(item['Id']) for all_episodes in mb.get_items(item['Id'], "Episode"):
self.add_episodes(all_episodes['Items']) self.add_episodes(all_episodes['Items'])
def add_seasons(self, items, total=None, view=None): def add_seasons(self, items, total=None, view=None):
@ -214,7 +215,7 @@ class TVShows(Items):
if self.add_updateSeason(item): if self.add_updateSeason(item):
# Add episodes # Add episodes
all_episodes = self.emby.getEpisodesbySeason(item['Id']) for all_episodes in mb.get_items(item['Id'], "Episode"):
self.add_episodes(all_episodes['Items']) self.add_episodes(all_episodes['Items'])
def add_episodes(self, items, total=None, view=None): def add_episodes(self, items, total=None, view=None):