1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-01-31 11:41:35 +01:00

[kemonoparty:favorite] fix exception when sorting None (#5692)

This commit is contained in:
Mike Fährmann 2024-06-05 16:38:26 +02:00
parent 7614bc458e
commit 2cab87c5b6
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -518,7 +518,8 @@ class KemonopartyFavoriteExtractor(KemonopartyExtractor):
if not sort:
sort = "updated"
users.sort(key=lambda x: x[sort], reverse=(order == "desc"))
users.sort(key=lambda x: x[sort] or util.NONE,
reverse=(order == "desc"))
for user in users:
user["_extractor"] = KemonopartyUserExtractor
@ -532,7 +533,8 @@ class KemonopartyFavoriteExtractor(KemonopartyExtractor):
if not sort:
sort = "faved_seq"
posts.sort(key=lambda x: x[sort], reverse=(order == "desc"))
posts.sort(key=lambda x: x[sort] or util.NONE,
reverse=(order == "desc"))
for post in posts:
post["_extractor"] = KemonopartyPostExtractor