Fix sort issue with new hash function #270

This commit is contained in:
Nathan Thomas 2022-01-14 21:07:41 -08:00
parent ad70d6bc56
commit eba4d451a9
2 changed files with 12 additions and 7 deletions

View file

@ -1,5 +1,5 @@
"""streamrip: the all in one music downloader."""
__version__ = "1.0"
__version__ = "1.9"
from . import clients, constants, converter, downloadtools, media

View file

@ -2302,12 +2302,17 @@ def _choose_and_download_cover(
) -> str:
# choose optimal cover size and download it
def sorted_list(x: Iterable) -> list:
xlist = list(x)
xlist.sort()
return xlist
hashcode: str = hashlib.md5(str(sorted_list(cover_urls.values())).encode('utf-8', errors='replace')).hexdigest()
hashcode: str = hashlib.md5(
"".join(
sorted(
map(
str,
cover_urls.values(),
)
)
).encode("utf-8", errors="ignore")
).hexdigest()
# hashcode: str = hashlib.md5(str(sorted_list(cover_urls.values())).encode('utf-8', errors='replace')).hexdigest()
temp_cover_path = os.path.join(gettempdir(), f"cover_{hashcode}.jpg")