From 2c3aca23e1e6ec773b5d9bc103b245231391c37e Mon Sep 17 00:00:00 2001 From: lonebyte <61915324+lonebyte@users.noreply.github.com> Date: Wed, 14 Jun 2023 20:25:18 +0200 Subject: [PATCH] Fix the sorting of fanart.tv covers fanart.tv uses a string to output the number of likes (see https://fanart.tv/api-docs/api-v3/). In order to sort numerically we need to convert the string into an int. --- beetsplug/fetchart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index b508a5f66..3259dfa53 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -590,7 +590,7 @@ class FanartTV(RemoteArtSource): self._log.debug('fanart.tv: unexpected mb_releasegroupid in ' 'response!') - matches.sort(key=lambda x: x['likes'], reverse=True) + matches.sort(key=lambda x: int(x['likes']), reverse=True) for item in matches: # fanart.tv has a strict size requirement for album art to be # uploaded