Skip to content

Commit

Permalink
get_album: don't overwrite parsed artist (closes #446)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Oct 3, 2023
1 parent d4a088d commit 9a87990
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def test_get_album(self):
self.assertEqual(len(results["other_versions"]), 2)
results = self.yt.get_album("MPREb_BQZvl3BFGay")
self.assertEqual(len(results["tracks"]), 7)
self.assertEqual(len(results["tracks"][0]["artists"]), 1)
results = self.yt.get_album("MPREb_rqH94Zr3NN0")
self.assertEqual(len(results["tracks"][0]["artists"]), 2)

def test_get_song(self):
song = self.yt_oauth.get_song(config["uploads"]["private_upload_id"]) # private upload
Expand Down
2 changes: 1 addition & 1 deletion ytmusicapi/mixins/browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def get_album(self, browseId: str) -> Dict:
album['duration_seconds'] = sum_total_duration(album)
for i, track in enumerate(album['tracks']):
album['tracks'][i]['album'] = album['title']
album['tracks'][i]['artists'] = album['artists']
album['tracks'][i]['artists'] = album['tracks'][i]['artists'] or album['artists']

return album

Expand Down

0 comments on commit 9a87990

Please sign in to comment.