fixed somethin

This commit is contained in:
Hellow2 2023-03-13 14:47:49 +01:00
parent e445e7b5d1
commit a7de1d2a68
2 changed files with 6 additions and 8 deletions

View File

@ -5,14 +5,10 @@ from music_kraken.pages import (
EncyclopaediaMetallum
)
"""
results = EncyclopaediaMetallum.search_by_query("#a Only Smile")
results = EncyclopaediaMetallum.search_by_query("#a Happy Days")
artist = results[0]
artist: objects.Artist = EncyclopaediaMetallum.fetch_details(artist)
print(artist.options)
print()
"""
if __name__ == "__main__":
pass

View File

@ -21,8 +21,10 @@ class Options:
return self._data[index].options
def __getitem__(self, item: int) -> 'Options':
def __getitem__(self, item: int) -> 'DatabaseObject':
if type(item) != int:
raise TypeError("Key needs to be an Integer")
if item >= len(self._data):
raise ValueError("Index out of bounds")
return self.get_next_options(item)
return self._data[item]