Skip to content

Commit

Permalink
check if audio provider provides views
Browse files Browse the repository at this point in the history
  • Loading branch information
xnetcat committed Jun 10, 2023
1 parent f0ece43 commit 3f0565c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spotdl/providers/audio/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ def get_best_result(self, results: Dict[Result, float]) -> Tuple[Result, float]:

highest_views = max(views)
lowest_views = min(views)

if highest_views in (0, lowest_views):
return best_result[0], best_result[1]

weighted_results = []
for index, (best_result, match_score) in enumerate(best_results):
result_views = views[index]
Expand Down

0 comments on commit 3f0565c

Please sign in to comment.