Skip to content

Commit

Permalink
Merge pull request #1221 from spotDL/dev
Browse files Browse the repository at this point in the history
* Update provider.py (#1218)
Authored by @xnetcat

Co-authored-by: Jakub <42355410+xnetcat@users.noreply.github.com>
  • Loading branch information
Silverarmor and xnetcat authored Mar 19, 2021
2 parents 922f97c + 72d3d27 commit 5dfe080
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spotdl/search/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ def search_and_order_ytm_results(songName: str, songArtists: List[str],
albumMatch = 0.0

if result['type'] == 'song':
albumMatch = match_percentage(result['album'], songAlbumName)
album = result.get('album')
if album:
albumMatch = match_percentage(album, songAlbumName)

# Find duration match
# ! time match = 100 - (delta(duration)**2 / original duration * 100)
Expand Down

0 comments on commit 5dfe080

Please sign in to comment.