Skip to content

Commit abb3dc0

Browse files
committed
fixed minor memory leak and docstrings
1 parent e5859f1 commit abb3dc0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ChillBot/music.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def name(self) -> str:
2222
def plays(self) -> int:
2323
"""How many times it was played
2424
25-
Type: str
25+
Type: int
2626
"""
2727
return self._plays
2828

@@ -46,7 +46,7 @@ def name(self) -> str:
4646
def tracks(self) -> list[TrackItem]:
4747
"""Amount of tracks
4848
49-
Type: dict
49+
Type: list[TrackItem]
5050
"""
5151
return [TrackItem(x, y) for x, y in self._artist.get('tracks').items()]
5252

@@ -70,7 +70,7 @@ def id(self) -> int:
7070
def artists(self) -> list[ArtistListItem]:
7171
"""Returns the list of artists
7272
73-
Type: list
73+
Type: list[ArtistListItem]
7474
"""
7575
return [ArtistListItem(x) for x in self._response.get('artists')]
7676

ChillBot/requests.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ def __init__(self, headers: dict[str, str], params: dict[str, str]):
1212

1313
async def GET(self, endpoint: str):
1414
response: aiohttp.ClientSession = await self._client.get(BaseAPI + endpoint, params=self._params)
15+
16+
await self._client.close()
1517
return response

0 commit comments

Comments
 (0)