Compare commits

...
4 Commits
Author SHA1 Message Date
LinForandPingWin 096e22156c ExternalUrlProvider (#49)
Co-authored-by: PingWin <kirill@shashlov.ru>
2026-01-16 00:36:06 +03:00
github-actions[bot] 217d2efef8 Added to manifest version 10.9.8.0 [skip ci] 2026-01-15 17:48:23 +00:00
LinFor c00f8dd712 Update CHANGELOG for version 10.9.8.0
Moved significant code from the respected fork by @VD42.
2026-01-15 20:47:34 +03:00
PingWin 56ee78af00 Merged code from @VD42 fork 2026-01-15 20:46:10 +03:00
9 changed files with 91 additions and 35 deletions

No files matched your search

+4 -4
View File
@@ -11,12 +11,12 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v3
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Build project
run: dotnet build --configuration Release ./src
+1 -1
View File
@@ -6,7 +6,7 @@ on:
env:
DIST_ARCHIVES_PATH: dist/kinopoisk
MANIFEST_FILE: dist/manifest.json
TARGET_ABI: 10.9.0
TARGET_ABI: 10.10.0
jobs:
build:
+9 -1
View File
@@ -1,5 +1,13 @@
# Changelog
## [10.10.1.0]
Реализован IExternalUrlProvider (ссылки на кинопоиск)
## [10.9.8.0]
Перенесён значимый код из форка уважаемого @VD42
## [10.9.7.0]
Fixed pluginId
@@ -86,4 +94,4 @@ new release
## [10.6.0.0]
new release
new release
+8
View File
@@ -8,6 +8,14 @@
"description": "Загружает рейтинг, описания, актёров, трейлеры и т.д. с сайта КиноПоиск. Может потребоваться зарегистрировать свой ApiToken, см. информацию в параметрах плагина. Для точного распознавания рекомендуется указывать id фильма с сайта КиноПоиск в имени файла в формате kp-12345 или kp12345. Подробнее см. https://github.com/LinFor/jellyfin-plugin-kinopoisk/blob/master/README.md\n",
"imageUrl": "https://kinopoisk.userecho.com/s/attachments/28876/0/1/25f8c0315e6ccb2aa6c2642e48f2c9e9.png",
"versions": [
{
"version": "10.9.8.0",
"checksum": "8ce2e57a7411c393a5ac23d31f50265a",
"changelog": "Перенесён значимый код из форка уважаемого @VD42",
"targetAbi": "10.9.0",
"sourceUrl": "https://github.com/LinFor/jellyfin-plugin-kinopoisk/releases/download/v10.9.8.0/jellyfin-plugin-kinopoisk_10.9.8.0.zip",
"timestamp": "2026-01-15T17:48:23Z"
},
{
"version": "10.9.7.0",
"checksum": "5d3719a7c8a2d6e4af4fca53f736392e",
@@ -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,
@@ -13,13 +13,13 @@ namespace Jellyfin.Plugin.Kinopoisk.Model
public string Key => Constants.ProviderId;
public string UrlFormatString => "https://www.kinopoisk.ru/film/{0}";
public string UrlFormatString => null;
public ExternalIdMediaType? Type => null;
public bool Supports(IHasProviderIds item)
{
return item is Movie || item is Series;
return item is Movie || item is Series || item is Person;
}
}
}
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
namespace Jellyfin.Plugin.Kinopoisk.Model
{
/// <summary>
/// External URLs for Kinopoisk.
/// </summary>
public class KinopoiskExternalUrlProvider : IExternalUrlProvider
{
/// <inheritdoc/>
public string Name => Constants.ProviderName;
/// <inheritdoc/>
public IEnumerable<string> GetExternalUrls(BaseItem item)
{
var baseUrl = "https://www.kinopoisk.ru/";
if (item.TryGetProviderId(Constants.ProviderId, out var externalId))
{
if (item is Person)
{
yield return baseUrl + $"name/{externalId}/";
}
else if (item is Movie)
{
yield return baseUrl + $"film/{externalId}/";
}
else if (item is Series)
{
yield return baseUrl + $"series/{externalId}/";
}
}
}
}
}
@@ -1,23 +0,0 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
namespace Jellyfin.Plugin.Kinopoisk.Model
{
public class KinopoiskPersonExternalId : IExternalId
{
public string ProviderName => Constants.ProviderName;
public string Key => Constants.ProviderId;
public string UrlFormatString => "https://www.kinopoisk.ru/name/{0}";
public ExternalIdMediaType? Type => null;
public bool Supports(IHasProviderIds item)
{
return item is Person;
}
}
}
@@ -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);
}