Split internal logic of for_each_episode to iterate episodes
@@ -123,6 +123,11 @@ def for_each_pair(sections, trakt: TraktApi):
def for_each_episode(sections, trakt: TraktApi):
for pm, tm in for_each_pair(sections, trakt):
+ for tm, pe, te in for_each_show_episode(pm, tm, trakt):
+ yield tm, pe, te
+
+
+def for_each_show_episode(pm, tm, trakt: TraktApi):
lookup = trakt.lookup(tm)
# loop over episodes in plex db
