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.
This commit is contained in:
lonebyte 2023-06-14 20:25:18 +02:00 committed by GitHub
parent 0c3f428a60
commit 2c3aca23e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -590,7 +590,7 @@ class FanartTV(RemoteArtSource):
self._log.debug('fanart.tv: unexpected mb_releasegroupid in ' self._log.debug('fanart.tv: unexpected mb_releasegroupid in '
'response!') 'response!')
matches.sort(key=lambda x: x['likes'], reverse=True) matches.sort(key=lambda x: int(x['likes']), reverse=True)
for item in matches: for item in matches:
# fanart.tv has a strict size requirement for album art to be # fanart.tv has a strict size requirement for album art to be
# uploaded # uploaded