Sort by vote count and use case insensitive match for perfect matches

This commit is contained in:
Zoe Roux 2024-05-03 00:47:54 +02:00
parent bc75576e4b
commit 3725ed89db
No known key found for this signature in database

View File

@ -533,10 +533,10 @@ class TheMovieDatabase(Provider):
(
x
for x in results
if ("name" in x and x["name"] == name)
or ("title" in x and x["title"] == name)
if ("name" in x and x["name"].casefold() == name.casefold())
or ("title" in x and x["title"].casefold() == name.casefold())
),
key=lambda x: x["popularity"],
key=lambda x: (x["vote_count"], x["popularity"]),
reverse=True,
)
if res: