From 413d422e2fdc4630c06d162ecbcb6cd7e414deff Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Mon, 27 May 2024 16:38:03 +0200 Subject: [PATCH] draft: improved searching one page only --- music_kraken/download/components.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/music_kraken/download/components.py b/music_kraken/download/components.py index e170e60..5aefdab 100644 --- a/music_kraken/download/components.py +++ b/music_kraken/download/components.py @@ -254,13 +254,13 @@ class DataObjectSelect(Select): def __iter__(self): source_types = list(sorted(self._source_type_to_data_objects.keys(), key=lambda x: x.name)) - has_limit = len(source_types) > 1 + single_source = len(source_types) > 1 for st in source_types: - if has_limit: + if single_source: yield self._source_type_to_option[st] - limit = min(15, len(self._source_type_to_data_objects[st])) if has_limit else len(self._source_type_to_data_objects[st]) + limit = min(15, len(self._source_type_to_data_objects[st])) if single_source else len(self._source_type_to_data_objects[st]) for i in range(limit): yield self._source_type_to_data_objects[st][i] \ No newline at end of file