From e34359c66bbe017c2dce58de9285a79c35240d06 Mon Sep 17 00:00:00 2001 From: Jordan Shatford Date: Mon, 23 Oct 2023 17:02:26 +1100 Subject: [PATCH] fix(core): issue causing search continuation to not work Signed-off-by: Jordan Shatford --- core/ydcore/search.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/ydcore/search.py b/core/ydcore/search.py index e3b6b4cf..79895b5d 100644 --- a/core/ydcore/search.py +++ b/core/ydcore/search.py @@ -18,13 +18,13 @@ def _get(source: dict[Any, Any], path: list[Any]) -> Any: if key in value: value = value[key] else: - return None + raise KeyError(key) # If the key is for a list elif type(key) is int: if len(value) != 0: value = value[key] else: - return None + raise KeyError(key) return value @@ -46,8 +46,8 @@ def results(self) -> list[Video]: def next(self) -> bool: # If continuation exists, fetch new results to replace existing ones. if self._continuation: - videos, continuation = self._fetch_and_parse() - self._results = videos + results, continuation = self._fetch_and_parse() + self._results = results self._continuation = continuation return True else: