Compare commits
1
Commits
v10.10.4.0
...
vd42-merge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11f5f1c921 |
No files matched your search
@@ -101,6 +101,8 @@ namespace Jellyfin.Plugin.Kinopoisk
|
||||
dst.Name = src.GetLocalName();
|
||||
dst.OriginalTitle = src.GetOriginalNameIfNotSame();
|
||||
dst.PremiereDate = src.GetPremiereDate();
|
||||
if (1900 < src.Year)
|
||||
dst.ProductionYear = src.Year;
|
||||
if (!string.IsNullOrWhiteSpace(src.Slogan))
|
||||
dst.Tagline = src.Slogan;
|
||||
dst.Overview = src.Description;
|
||||
@@ -270,10 +272,13 @@ namespace Jellyfin.Plugin.Kinopoisk
|
||||
return src switch
|
||||
{
|
||||
StaffResponseProfessionKey.ACTOR => PersonKind.Actor,
|
||||
StaffResponseProfessionKey.DIRECTOR => PersonKind.Director,
|
||||
StaffResponseProfessionKey.DIRECTOR
|
||||
or StaffResponseProfessionKey.VOICE_DIRECTOR
|
||||
or StaffResponseProfessionKey.OPERATOR => PersonKind.Director,
|
||||
StaffResponseProfessionKey.WRITER => PersonKind.Writer,
|
||||
StaffResponseProfessionKey.COMPOSER => PersonKind.Composer,
|
||||
StaffResponseProfessionKey.PRODUCER or StaffResponseProfessionKey.PRODUCER_USSR => PersonKind.Producer,
|
||||
StaffResponseProfessionKey.PRODUCER
|
||||
or StaffResponseProfessionKey.PRODUCER_USSR => PersonKind.Producer,
|
||||
StaffResponseProfessionKey.EDITOR => PersonKind.Editor,
|
||||
StaffResponseProfessionKey.TRANSLATOR => PersonKind.Translator,
|
||||
_ => PersonKind.Unknown,
|
||||
|
||||
@@ -44,13 +44,15 @@ namespace Jellyfin.Plugin.Kinopoisk.ProviderIdResolvers
|
||||
var candidates = searchResult.Films.ToArray();
|
||||
_logger.LogDebug($"Received {candidates.Length} results, trying to filter and match...");
|
||||
|
||||
var candidates_by_year = FilterByYear(info, candidates);
|
||||
|
||||
// Check if there are single candidate filtered by year
|
||||
possibleResult = await TryResolveBySingleCandidateLeft(info, FilterByYear(info, candidates), ct);
|
||||
possibleResult = await TryResolveBySingleCandidateLeft(info, candidates_by_year, ct);
|
||||
if (possibleResult.IsSuccess)
|
||||
return possibleResult;
|
||||
|
||||
// Try to resolve by ImdbId match filtered by year
|
||||
possibleResult = await TryResolveByImdbMatch(info, FilterByYear(info, candidates), ct);
|
||||
possibleResult = await TryResolveByImdbMatch(info, candidates_by_year, ct);
|
||||
if (possibleResult.IsSuccess)
|
||||
return possibleResult;
|
||||
|
||||
@@ -59,6 +61,22 @@ namespace Jellyfin.Plugin.Kinopoisk.ProviderIdResolvers
|
||||
if (possibleResult.IsSuccess)
|
||||
return possibleResult;
|
||||
|
||||
// TODO: Maybe check type?
|
||||
|
||||
if (0 < candidates_by_year.Count)
|
||||
{
|
||||
var kinopoiskId = candidates_by_year.First().FilmId;
|
||||
_logger.LogDebug($"All other checks failed, use first result by year, setting KinopoiskProviderId to {kinopoiskId} ({info.Name})");
|
||||
return (true, kinopoiskId);
|
||||
}
|
||||
|
||||
if (0 < candidates.Length)
|
||||
{
|
||||
var kinopoiskId = candidates.First().FilmId;
|
||||
_logger.LogDebug($"All other checks failed, use first result, setting KinopoiskProviderId to {kinopoiskId} ({info.Name})");
|
||||
return (true, kinopoiskId);
|
||||
}
|
||||
|
||||
_logger.LogDebug($"Suitable result not found");
|
||||
return (false, 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user