pass max_episodes to custom feed handlers

This commit is contained in:
Eric Le Lay 2019-05-19 15:04:17 +02:00
parent 80b3b69837
commit 0b36f1ee60
2 changed files with 4 additions and 4 deletions

View File

@ -55,9 +55,9 @@ class gPodderFetcher(feedcore.Fetcher):
"""
custom_handlers = []
def fetch_channel(self, channel):
def fetch_channel(self, channel, max_episodes):
for handler in self.custom_handlers:
custom_feed = handler.fetch_channel(channel)
custom_feed = handler.fetch_channel(channel, max_episodes)
if custom_feed is not None:
return feedcore.Result(feedcore.CUSTOM_FEED, custom_feed)
# If we have a username or password, rebuild the url with them included
@ -1025,7 +1025,7 @@ class PodcastChannel(PodcastModelObject):
def update(self, max_episodes=0):
try:
result = self.feed_fetcher.fetch_channel(self)
result = self.feed_fetcher.fetch_channel(self, max_episodes)
if result.status == feedcore.CUSTOM_FEED:
self._consume_custom_feed(result.feed, max_episodes)

View File

@ -188,7 +188,7 @@ class SoundcloudFeed(object):
URL_REGEX = re.compile('https?://([a-z]+\.)?soundcloud\.com/([^/]+)$', re.I)
@classmethod
def fetch_channel(cls, channel):
def fetch_channel(cls, channel, max_episodes=0):
url = channel.authenticate_url(channel.url)
return cls.handle_url(url)