From d866c0e3af43a6dc134c0334119730bc626031a3 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 14 Dec 2021 00:52:56 -0500 Subject: [PATCH] #506 fix flixpatrol limit --- modules/flixpatrol.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/flixpatrol.py b/modules/flixpatrol.py index b30f6cfb..6e3106cf 100644 --- a/modules/flixpatrol.py +++ b/modules/flixpatrol.py @@ -53,7 +53,7 @@ class FlixPatrol: raise Failed(f"FlixPatrol Error: TMDb Movie ID not found in {ids[0]}") raise Failed(f"FlixPatrol Error: TMDb Movie ID not found at {flixpatrol_url}") - def _parse_list(self, list_url, language, is_movie): + def _parse_list(self, list_url, language, is_movie, limit=0): flixpatrol_urls = [] if list_url.startswith(urls["top10"]): platform = list_url[len(urls["top10"]):].split("/")[0] @@ -73,7 +73,7 @@ class FlixPatrol: list_url, language, f"//a[@class='flex group' and .//span[.='{'Movie' if is_movie else 'TV Show'}']]/@href" ) - return flixpatrol_urls + return flixpatrol_urls if limit == 0 else flixpatrol_urls[:limit] def validate_flixpatrol_lists(self, flixpatrol_lists, language, is_movie): valid_lists = [] @@ -133,7 +133,7 @@ class FlixPatrol: logger.info(f"Processing FlixPatrol URL: {data}") url = self.get_url(method, data, is_movie) - items = self._parse_list(url, language, is_movie) + items = self._parse_list(url, language, is_movie, limit=data["limit"] if isinstance(data, dict) else 0) media_type = "movie" if is_movie else "show" total_items = len(items) if total_items > 0: