Updated
This commit is contained in:
parent
ca1e603cc0
commit
9b85848522
@ -5,3 +5,4 @@ fuzzywuzzy>=0.18.0
|
|||||||
requests>=2.31.0
|
requests>=2.31.0
|
||||||
python-Levenshtein>=0.21.1
|
python-Levenshtein>=0.21.1
|
||||||
mal-api>=0.5.3
|
mal-api>=0.5.3
|
||||||
|
unicode>=2.9
|
||||||
@ -6,6 +6,8 @@ from .anii import metadata as AniiMetadata
|
|||||||
from .imdb import metadata as ImdbMetadata
|
from .imdb import metadata as ImdbMetadata
|
||||||
from .mal import metadata as MalMetadata
|
from .mal import metadata as MalMetadata
|
||||||
from fuzzywuzzy import fuzz
|
from fuzzywuzzy import fuzz
|
||||||
|
from unidecode import unidecode
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -31,14 +33,14 @@ class UseSource():
|
|||||||
|
|
||||||
result: List[WeightedData] = []
|
result: List[WeightedData] = []
|
||||||
if (anii is not None) and (anii.status == "COMPLETED" and anii.data is not None):
|
if (anii is not None) and (anii.status == "COMPLETED" and anii.data is not None):
|
||||||
result.append(WeightedData(anii, 4))
|
result.append(WeightedData(anii, 2))
|
||||||
if (imdb is not None) and (imdb.status == "COMPLETED" and imdb.data is not None):
|
if (imdb is not None) and (imdb.status == "COMPLETED" and imdb.data is not None):
|
||||||
imdb_weight = 1
|
imdb_weight = 1
|
||||||
if (imdb.data.title == title):
|
if (imdb.data.title == title or unidecode(imdb.data.title) == unidecode(title)):
|
||||||
imdb_weight = 7
|
imdb_weight = 10
|
||||||
result.append(WeightedData(imdb, imdb_weight))
|
result.append(WeightedData(imdb, imdb_weight))
|
||||||
if (mal is not None) and (mal.status == "COMPLETED" and mal.data is not None):
|
if (mal is not None) and (mal.status == "COMPLETED" and mal.data is not None):
|
||||||
result.append(WeightedData(mal, 8))
|
result.append(WeightedData(mal, 4))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def __calculate_score(self, title: str, weightData: List[WeightedData]) -> List[DataAndScore]:
|
def __calculate_score(self, title: str, weightData: List[WeightedData]) -> List[DataAndScore]:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user