implemented the deletion of unnecesarry details in not chosen objects, for the sake of memory efficiency in the history

This commit is contained in:
Hellow2
2023-06-16 10:43:35 +02:00
parent b20d7fcc76
commit f471c6a72b
4 changed files with 18 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ class Shell:
self.max_displayed_options = max_displayed_options
self.option_digits: int = option_digits
self.current_results: Results = SearchResults
self.current_results: Results = None
self._result_history: List[Results] = []
self.genre = genre or get_genre()
@@ -296,6 +296,9 @@ class Shell:
page: Type[Page]
music_object: DatabaseObject
if self.current_results is not None:
self.current_results.delete_details(index)
try:
page, music_object = self.current_results.get_music_object_by_index(index)
except KeyError: