Add log.debug when RSS doesn't contain ID, and rename variables.
This commit is contained in:
parent
4f6080859a
commit
eec72db4fd
1 changed files with 5 additions and 5 deletions
|
@ -185,22 +185,22 @@ class YCDLDBChannelMixin:
|
||||||
|
|
||||||
def gen():
|
def gen():
|
||||||
for channel in self.get_channels():
|
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:
|
try:
|
||||||
rss_videos = ytrss.get_user_videos(channel.id)
|
rss_ids = ytrss.get_user_videos(channel.id)
|
||||||
except Exception:
|
except Exception:
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
traditional(channel)
|
traditional(channel)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
index = rss_videos.index(most_recent_video)
|
index = rss_ids.index(most_recent_id)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# traceback.print_exc()
|
self.log.debug('RSS didn\'t contain %s. Calling API refresh.', most_recent_id)
|
||||||
traditional(channel)
|
traditional(channel)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
new_ids = rss_videos[:index]
|
new_ids = rss_ids[:index]
|
||||||
yield from new_ids
|
yield from new_ids
|
||||||
|
|
||||||
for video in self.youtube.get_videos(gen()):
|
for video in self.youtube.get_videos(gen()):
|
||||||
|
|
Loading…
Reference in a new issue