Compare commits

..

5 Commits

Author SHA1 Message Date
cxfksword d4dfc6ad42 tweak: optimize identify
# Conflicts:
#	Jellyfin.Plugin.MetaShark/Providers/SeasonProvider.cs
2024-06-08 10:28:58 +08:00
cxfksword 2408a2f418 feat: support path name attribute. close #75 2024-06-08 10:22:35 +08:00
cxfksword 945930d75e fix: episode number not correctly identified. #82 2024-05-25 16:02:32 +08:00
cxfksword b2264405d5 build: update github action 2024-05-22 20:39:37 +08:00
cxfksword 4ae795d503 fix: actor lack of overview. close #80 2024-05-18 16:14:50 +08:00
13 changed files with 49 additions and 44 deletions

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
dotnet-version: 8.0.x dotnet-version: 6.0.x
python-version: 3.8 python-version: 3.8
project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
artifact: metashark artifact: metashark
@ -36,9 +36,9 @@ jobs:
- name: Build - name: Build
run: | run: |
dotnet restore ${{ env.project }} --no-cache dotnet restore ${{ env.project }} --no-cache
dotnet publish --nologo --no-restore --configuration=Release --framework=net8.0 ${{ env.project }} dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 ${{ env.project }}
mkdir -p artifacts mkdir -p artifacts
cp ./Jellyfin.Plugin.MetaShark/bin/Release/net8.0/Jellyfin.Plugin.MetaShark.dll ./artifacts/ cp ./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll ./artifacts/
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-dotnet@v3 - uses: actions/setup-dotnet@v3
id: dotnet id: dotnet
with: with:
dotnet-version: 8.0.x dotnet-version: 6.0.x
- name: Change default dotnet version - name: Change default dotnet version
run: | run: |
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json

View File

@ -5,7 +5,7 @@ on:
tags: ["*"] tags: ["*"]
env: env:
dotnet-version: 8.0.x dotnet-version: 6.0.x
python-version: 3.8 python-version: 3.8
project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
artifact: metashark artifact: metashark
@ -41,9 +41,9 @@ jobs:
- name: Build - name: Build
run: | run: |
dotnet restore ${{ env.project }} --no-cache dotnet restore ${{ env.project }} --no-cache
dotnet publish --nologo --no-restore --configuration=Release --framework=net8.0 -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }} dotnet publish --nologo --no-restore --configuration=Release --framework=net6.0 -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }}
mkdir -p artifacts mkdir -p artifacts
zip -j ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ./Jellyfin.Plugin.MetaShark/bin/Release/net8.0/Jellyfin.Plugin.MetaShark.dll zip -j ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll
- name: Generate manifest - name: Generate manifest
run: python3 ./scripts/generate_manifest.py ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/} run: python3 ./scripts/generate_manifest.py ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/}
env: env:
@ -54,7 +54,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./artifacts/${{ env.artifact }}_*.zip file: ./artifacts/${{ env.artifact }}_*.zip
tag: ${{ github.ref }} tag: ${{ github.ref }}
release_name: '${{ github.ref_name }}: Jellyfin v10.9' release_name: '${{ github.ref_name }}: Jellyfin v10.8'
file_glob: true file_glob: true
overwrite: true overwrite: true
- name: Publish manifest - name: Publish manifest

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>AnitomySharp.NET6</PackageId> <PackageId>AnitomySharp.NET6</PackageId>
<PackageVersion>0.4.0</PackageVersion> <PackageVersion>0.4.0</PackageVersion>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.MetaShark</RootNamespace> <RootNamespace>Jellyfin.Plugin.MetaShark</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile> <GenerateDocumentationFile>False</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@ -21,12 +21,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.1" /> <PackageReference Include="AngleSharp" Version="1.0.1" />
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.32"> <PackageReference Include="ILRepack.Lib.MSBuild.Minor" Version="2.1.19-alpha.2" />
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <PackageReference Include="Jellyfin.Controller" Version="10.8.0" />
<PrivateAssets>all</PrivateAssets> <PackageReference Include="Jellyfin.Model" Version="10.8.0" />
</PackageReference>
<PackageReference Include="Jellyfin.Controller" Version="10.9.0" />
<PackageReference Include="Jellyfin.Model" Version="10.9.0" />
<PackageReference Include="RateLimiter" Version="2.2.0" /> <PackageReference Include="RateLimiter" Version="2.2.0" />
<PackageReference Include="TMDbLib" Version="2.2.0" /> <PackageReference Include="TMDbLib" Version="2.2.0" />
</ItemGroup> </ItemGroup>

View File

@ -133,13 +133,13 @@ namespace Jellyfin.Plugin.MetaShark.Providers
item = result.Where(x => x.Year == info.Year && x.Name == searchName).FirstOrDefault(); item = result.Where(x => x.Year == info.Year && x.Name == searchName).FirstOrDefault();
if (item != null) if (item != null)
{ {
this.Log($"Found douban [id]: {item.Name}({item.Sid}) (suggest)"); this.Log($"GuessByDouban found -> {item.Name}({item.Sid}) (suggest)");
return item.Sid; return item.Sid;
} }
item = result.Where(x => x.Year == info.Year).FirstOrDefault(); item = result.Where(x => x.Year == info.Year).FirstOrDefault();
if (item != null) if (item != null)
{ {
this.Log($"Found douban [id]: {item.Name}({item.Sid}) (suggest)"); this.Log($"GuessByDouban found -> {item.Name}({item.Sid}) (suggest)");
return item.Sid; return item.Sid;
} }
} }
@ -177,7 +177,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
item = result.Where(x => x.Category == cat).FirstOrDefault(); item = result.Where(x => x.Category == cat).FirstOrDefault();
if (item != null) if (item != null)
{ {
this.Log($"Found douban [id] by first match: {item.Name}({item.Sid})"); this.Log($"GuessByDouban found -> {item.Name}({item.Sid})");
return item.Sid; return item.Sid;
} }

View File

@ -7,7 +7,6 @@ using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using AngleSharp.Text; using AngleSharp.Text;
using Jellyfin.Data.Enums;
using Jellyfin.Plugin.MetaShark.Api; using Jellyfin.Plugin.MetaShark.Api;
using Jellyfin.Plugin.MetaShark.Core; using Jellyfin.Plugin.MetaShark.Core;
using Jellyfin.Plugin.MetaShark.Model; using Jellyfin.Plugin.MetaShark.Model;
@ -183,7 +182,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo
{ {
Name = c.Name, Name = c.Name,
Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor, Type = c.RoleType,
Role = c.Role, Role = c.Role,
ImageUrl = this.GetLocalProxyImageUrl(c.Img), ImageUrl = this.GetLocalProxyImageUrl(c.Img),
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } }, ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } },
@ -302,7 +301,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = actor.Name.Trim(), Name = actor.Name.Trim(),
Role = actor.Character, Role = actor.Character,
Type = PersonKind.Actor, Type = PersonType.Actor,
SortOrder = actor.Order, SortOrder = actor.Order,
}; };
@ -345,7 +344,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = person.Name.Trim(), Name = person.Name.Trim(),
Role = person.Job, Role = person.Job,
Type = type == PersonType.Director ? PersonKind.Director : (type == PersonType.Producer ? PersonKind.Producer : PersonKind.Actor), Type = type
}; };
if (!string.IsNullOrWhiteSpace(person.ProfilePath)) if (!string.IsNullOrWhiteSpace(person.ProfilePath))

View File

@ -14,7 +14,6 @@ using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Jellyfin.Data.Enums;
using System.IO; using System.IO;
namespace Jellyfin.Plugin.MetaShark.Providers namespace Jellyfin.Plugin.MetaShark.Providers
@ -93,7 +92,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo
{ {
Name = c.Name, Name = c.Name,
Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor, Type = c.RoleType,
Role = c.Role, Role = c.Role,
ImageUrl = this.GetLocalProxyImageUrl(c.Img), ImageUrl = this.GetLocalProxyImageUrl(c.Img),
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } }, ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } },

View File

@ -1,5 +1,4 @@
using Jellyfin.Data.Enums; using Jellyfin.Plugin.MetaShark.Api;
using Jellyfin.Plugin.MetaShark.Api;
using Jellyfin.Plugin.MetaShark.Model; using Jellyfin.Plugin.MetaShark.Model;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Entities.TV;
@ -153,7 +152,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo
{ {
Name = c.Name, Name = c.Name,
Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor, Type = c.RoleType,
Role = c.Role, Role = c.Role,
ImageUrl = this.GetLocalProxyImageUrl(c.Img), ImageUrl = this.GetLocalProxyImageUrl(c.Img),
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } }, ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } },
@ -357,7 +356,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = actor.Name.Trim(), Name = actor.Name.Trim(),
Role = actor.Character, Role = actor.Character,
Type = PersonKind.Actor, Type = PersonType.Actor,
SortOrder = actor.Order, SortOrder = actor.Order,
}; };
@ -401,7 +400,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = person.Name.Trim(), Name = person.Name.Trim(),
Role = person.Job, Role = person.Job,
Type = type == PersonType.Director ? PersonKind.Director : (type == PersonType.Producer ? PersonKind.Producer : PersonKind.Actor), Type = type
}; };
if (!string.IsNullOrWhiteSpace(person.ProfilePath)) if (!string.IsNullOrWhiteSpace(person.ProfilePath))

View File

@ -1,8 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Jellyfin.Plugin.MetaShark.Api; using Jellyfin.Plugin.MetaShark.Api;
using MediaBrowser.Controller; using Jellyfin.Plugin.MetaShark.Providers;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Providers;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using MediaBrowser.Controller.Persistence;
using System.Net.Http;
namespace Jellyfin.Plugin.MetaShark namespace Jellyfin.Plugin.MetaShark
{ {
@ -10,22 +20,21 @@ namespace Jellyfin.Plugin.MetaShark
public class ServiceRegistrator : IPluginServiceRegistrator public class ServiceRegistrator : IPluginServiceRegistrator
{ {
/// <inheritdoc /> /// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost) public void RegisterServices(IServiceCollection serviceCollection)
{ {
serviceCollection.AddSingleton<DoubanApi>((ctx) =>
serviceCollection.AddSingleton((ctx) =>
{ {
return new DoubanApi(ctx.GetRequiredService<ILoggerFactory>()); return new DoubanApi(ctx.GetRequiredService<ILoggerFactory>());
}); });
serviceCollection.AddSingleton((ctx) => serviceCollection.AddSingleton<TmdbApi>((ctx) =>
{ {
return new TmdbApi(ctx.GetRequiredService<ILoggerFactory>()); return new TmdbApi(ctx.GetRequiredService<ILoggerFactory>());
}); });
serviceCollection.AddSingleton((ctx) => serviceCollection.AddSingleton<OmdbApi>((ctx) =>
{ {
return new OmdbApi(ctx.GetRequiredService<ILoggerFactory>()); return new OmdbApi(ctx.GetRequiredService<ILoggerFactory>());
}); });
serviceCollection.AddSingleton((ctx) => serviceCollection.AddSingleton<ImdbApi>((ctx) =>
{ {
return new ImdbApi(ctx.GetRequiredService<ILoggerFactory>()); return new ImdbApi(ctx.GetRequiredService<ILoggerFactory>());
}); });

View File

@ -1,7 +1,7 @@
# jellyfin-plugin-metashark # jellyfin-plugin-metashark
[![release](https://img.shields.io/github/v/release/cxfksword/jellyfin-plugin-metashark)](https://github.com/cxfksword/jellyfin-plugin-metashark/releases) [![release](https://img.shields.io/github/v/release/cxfksword/jellyfin-plugin-metashark)](https://github.com/cxfksword/jellyfin-plugin-metashark/releases)
[![platform](https://img.shields.io/badge/jellyfin-10.8.x|10.9.x-lightgrey?logo=jellyfin)](https://github.com/cxfksword/jellyfin-plugin-metashark/releases) [![platform](https://img.shields.io/badge/jellyfin-10.8.x-lightgrey?logo=jellyfin)](https://github.com/cxfksword/jellyfin-plugin-metashark/releases)
[![license](https://img.shields.io/github/license/cxfksword/jellyfin-plugin-metashark)](https://github.com/cxfksword/jellyfin-plugin-metashark/main/LICENSE) [![license](https://img.shields.io/github/license/cxfksword/jellyfin-plugin-metashark)](https://github.com/cxfksword/jellyfin-plugin-metashark/main/LICENSE)
jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMovieDb补全缺失的剧集数据。 jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMovieDb补全缺失的剧集数据。
@ -14,9 +14,11 @@ jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMov
## 安装插件 ## 安装插件
只支持最新的`jellyfin 10.8.x`版本
添加插件存储库: 添加插件存储库:
国内加速https://gitee.com/cwhzy/jellyfin-plugin-metashark/releases/download/manifest/manifest_cn.json 国内加速https://mirror.ghproxy.com/https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest_cn.json
国外访问https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest.json 国外访问https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest.json
@ -40,7 +42,7 @@ jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMov
1. Clone or download this repository 1. Clone or download this repository
2. Ensure you have .NET Core SDK 8.0 setup and installed 2. Ensure you have .NET Core SDK 6.0 setup and installed
3. Build plugin with following command. 3. Build plugin with following command.
@ -54,7 +56,7 @@ dotnet publish --configuration=Release Jellyfin.Plugin.MetaShark/Jellyfin.Plugin
1. Build the plugin 1. Build the plugin
2. Create a folder, like `metashark` and copy `./Jellyfin.Plugin.MetaShark/bin/Release/net8.0/Jellyfin.Plugin.MetaShark.dll` into it 2. Create a folder, like `metashark` and copy `./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll` into it
3. Move folder `metashark` to jellyfin `data/plugins` folder 3. Move folder `metashark` to jellyfin `data/plugins` folder

View File

@ -26,7 +26,7 @@ def generate_version(filepath, version, changelog):
return { return {
'version': f"{version}.0", 'version': f"{version}.0",
'changelog': changelog, 'changelog': changelog,
'targetAbi': '10.9.0.0', 'targetAbi': '10.8.0.0',
'sourceUrl': f'https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v{version}/metashark_{version}.0.zip', 'sourceUrl': f'https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/v{version}/metashark_{version}.0.zip',
'checksum': md5sum(filepath), 'checksum': md5sum(filepath),
'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S') 'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S')