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

@@ -29,6 +29,13 @@ class Results:
def get_music_object_by_index(self, index: int) -> Tuple[Type[Page], DatabaseObject]:
# if this throws a key error, either the formated generator needs to be iterated, or the option doesn't exist.
return self._page_by_index[index], self._by_index[index]
def delete_details(self, exclude_index: int):
for index, music_object in self._by_index.items():
if index == exclude_index:
continue
music_object.strip_details()
class SearchResults(Results):