From eec72db4fd923ebe9cd940612886699d22bd6b79 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 23 Sep 2020 19:02:01 -0700 Subject: [PATCH] Add log.debug when RSS doesn't contain ID, and rename variables. --- ycdl/ycdldb.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ycdl/ycdldb.py b/ycdl/ycdldb.py index 906be4a..4a571ab 100644 --- a/ycdl/ycdldb.py +++ b/ycdl/ycdldb.py @@ -185,22 +185,22 @@ class YCDLDBChannelMixin: def gen(): for channel in self.get_channels(): - most_recent_video = self.sql_select_one(query, [channel.id])[0] + most_recent_id = self.sql_select_one(query, [channel.id])[0] try: - rss_videos = ytrss.get_user_videos(channel.id) + rss_ids = ytrss.get_user_videos(channel.id) except Exception: # traceback.print_exc() traditional(channel) continue try: - index = rss_videos.index(most_recent_video) + index = rss_ids.index(most_recent_id) except ValueError: - # traceback.print_exc() + self.log.debug('RSS didn\'t contain %s. Calling API refresh.', most_recent_id) traditional(channel) continue - new_ids = rss_videos[:index] + new_ids = rss_ids[:index] yield from new_ids for video in self.youtube.get_videos(gen()):