Skip to content

Commit

Permalink
Fixed unwrapped integer values where string was expected
Browse files Browse the repository at this point in the history
This cause due to accessing raw values from a response
  • Loading branch information
helltraitor committed Jan 18, 2023
1 parent 2eedbb6 commit c3c4bb9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions downloader/extensions/yandex/models/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ async def prepare(self, session: ClientSession) -> None:
self.title = artists + " - " + self.title # type: ignore

for volume in meta_info["volumes"]:
self.volumes.append([Track(self.id, track["id"], alone=False, quality=self.quality)
for track in volume])
self.volumes.append([
Track(self.id, str(track["id"]), alone=False, quality=self.quality) for track in volume
])
1 change: 0 additions & 1 deletion downloader/extensions/yandex/models/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@ async def prepare(self, session: ClientSession) -> None:
self.name = meta_info["artist"]["name"]

for album in meta_info["albums"]:
# Album["id"] is integer
self.albums.append(Album(str(album["id"]), alone=False, quality=self.quality))
2 changes: 1 addition & 1 deletion downloader/extensions/yandex/models/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ async def prepare(self, session: ClientSession) -> None:
self.name = meta_info["label"]["name"]

for album in meta_info["albums"]:
self.albums.append(Album(album["id"], quality=self.quality))
self.albums.append(Album(str(album["id"]), quality=self.quality))
2 changes: 1 addition & 1 deletion downloader/extensions/yandex/models/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ async def prepare(self, session: ClientSession) -> None:
self.name = meta_info["playlist"]["title"]

for track in meta_info["playlist"]["tracks"]:
self.tracks.append(Track(track["albums"][0]["id"], track["id"], quality=self.quality))
self.tracks.append(Track(str(track["albums"][0]["id"]), str(track["id"]), quality=self.quality))

0 comments on commit c3c4bb9

Please sign in to comment.