Compare commits

..

11 Commits

Author SHA1 Message Date
cwhzy 2f44ddf6ec
update README.md.
Signed-off-by: cwhzy <cwhzy@foxmail.com>
2024-07-01 04:51:16 +00:00
cxfksword f337406ac9 tweak: optimize identify 2024-06-07 21:45:01 +08:00
cxfksword cb00027b77 fix: episode number not correctly identified. #82 2024-05-25 16:00:19 +08:00
cxfksword 9e9074bb5a build: update github action 2024-05-22 20:38:52 +08:00
cxfksword 747e69f3bf tweak: read attribute from season folder name 2024-05-18 16:12:52 +08:00
cxfksword 104d200e7b fix: actor lack of overview. close #80 2024-05-18 16:04:05 +08:00
cxfksword 8ded89422f
Merge pull request #78 from cxfksword/10.9/preview
tweak: update generate manifest version
2024-05-12 18:04:12 +08:00
cxfksword 25a844a2c4 tweak: update generate manifest version 2024-05-12 18:03:34 +08:00
cxfksword f1f35a6d32
Merge pull request #77 from cxfksword/10.9/preview
Compatible with Jellyfin 10.9
2024-05-12 18:00:02 +08:00
cxfksword 96be3222f9 feat: support path name attribute. close #75 2024-05-12 17:57:07 +08:00
cxfksword 1b547f7aaf Compatible with Jellyfin 10.9. #76 2024-05-12 17:15:46 +08:00
13 changed files with 44 additions and 49 deletions

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch: workflow_dispatch:
env: env:
dotnet-version: 6.0.x dotnet-version: 8.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=net6.0 ${{ env.project }} dotnet publish --nologo --no-restore --configuration=Release --framework=net8.0 ${{ env.project }}
mkdir -p artifacts mkdir -p artifacts
cp ./Jellyfin.Plugin.MetaShark/bin/Release/net6.0/Jellyfin.Plugin.MetaShark.dll ./artifacts/ cp ./Jellyfin.Plugin.MetaShark/bin/Release/net8.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: 6.0.x dotnet-version: 8.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: 6.0.x dotnet-version: 8.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=net6.0 -p:Version=${{steps.vars.outputs.VERSION}} ${{ env.project }} dotnet publish --nologo --no-restore --configuration=Release --framework=net8.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/net6.0/Jellyfin.Plugin.MetaShark.dll zip -j ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ./Jellyfin.Plugin.MetaShark/bin/Release/net8.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.8' release_name: '${{ github.ref_name }}: Jellyfin v10.9'
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>net6.0</TargetFramework> <TargetFramework>net8.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>net6.0</TargetFramework> <TargetFramework>net8.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>net6.0</TargetFramework> <TargetFramework>net8.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,9 +21,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.1" /> <PackageReference Include="AngleSharp" Version="1.0.1" />
<PackageReference Include="ILRepack.Lib.MSBuild.Minor" Version="2.1.19-alpha.2" /> <PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.32">
<PackageReference Include="Jellyfin.Controller" Version="10.8.0" /> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="Jellyfin.Model" Version="10.8.0" /> <PrivateAssets>all</PrivateAssets>
</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($"GuessByDouban found -> {item.Name}({item.Sid}) (suggest)"); this.Log($"Found douban [id]: {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($"GuessByDouban found -> {item.Name}({item.Sid}) (suggest)"); this.Log($"Found douban [id]: {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($"GuessByDouban found -> {item.Name}({item.Sid})"); this.Log($"Found douban [id] by first match: {item.Name}({item.Sid})");
return item.Sid; return item.Sid;
} }

View File

@ -7,6 +7,7 @@ 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;
@ -182,7 +183,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, Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor,
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 } },
@ -301,7 +302,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = actor.Name.Trim(), Name = actor.Name.Trim(),
Role = actor.Character, Role = actor.Character,
Type = PersonType.Actor, Type = PersonKind.Actor,
SortOrder = actor.Order, SortOrder = actor.Order,
}; };
@ -344,7 +345,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = person.Name.Trim(), Name = person.Name.Trim(),
Role = person.Job, Role = person.Job,
Type = type Type = type == PersonType.Director ? PersonKind.Director : (type == PersonType.Producer ? PersonKind.Producer : PersonKind.Actor),
}; };
if (!string.IsNullOrWhiteSpace(person.ProfilePath)) if (!string.IsNullOrWhiteSpace(person.ProfilePath))

View File

@ -14,6 +14,7 @@ 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
@ -92,7 +93,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, Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor,
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,4 +1,5 @@
using Jellyfin.Plugin.MetaShark.Api; using Jellyfin.Data.Enums;
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;
@ -152,7 +153,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, Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor,
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 } },
@ -356,7 +357,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = actor.Name.Trim(), Name = actor.Name.Trim(),
Role = actor.Character, Role = actor.Character,
Type = PersonType.Actor, Type = PersonKind.Actor,
SortOrder = actor.Order, SortOrder = actor.Order,
}; };
@ -400,7 +401,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
{ {
Name = person.Name.Trim(), Name = person.Name.Trim(),
Role = person.Job, Role = person.Job,
Type = type Type = type == PersonType.Director ? PersonKind.Director : (type == PersonType.Producer ? PersonKind.Producer : PersonKind.Actor),
}; };
if (!string.IsNullOrWhiteSpace(person.ProfilePath)) if (!string.IsNullOrWhiteSpace(person.ProfilePath))

View File

@ -1,18 +1,8 @@
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 Jellyfin.Plugin.MetaShark.Providers; using MediaBrowser.Controller;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Plugins;
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
{ {
@ -20,21 +10,22 @@ namespace Jellyfin.Plugin.MetaShark
public class ServiceRegistrator : IPluginServiceRegistrator public class ServiceRegistrator : IPluginServiceRegistrator
{ {
/// <inheritdoc /> /// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection) public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{ {
serviceCollection.AddSingleton<DoubanApi>((ctx) =>
serviceCollection.AddSingleton((ctx) =>
{ {
return new DoubanApi(ctx.GetRequiredService<ILoggerFactory>()); return new DoubanApi(ctx.GetRequiredService<ILoggerFactory>());
}); });
serviceCollection.AddSingleton<TmdbApi>((ctx) => serviceCollection.AddSingleton((ctx) =>
{ {
return new TmdbApi(ctx.GetRequiredService<ILoggerFactory>()); return new TmdbApi(ctx.GetRequiredService<ILoggerFactory>());
}); });
serviceCollection.AddSingleton<OmdbApi>((ctx) => serviceCollection.AddSingleton((ctx) =>
{ {
return new OmdbApi(ctx.GetRequiredService<ILoggerFactory>()); return new OmdbApi(ctx.GetRequiredService<ILoggerFactory>());
}); });
serviceCollection.AddSingleton<ImdbApi>((ctx) => serviceCollection.AddSingleton((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-lightgrey?logo=jellyfin)](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)
[![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,11 +14,9 @@ jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMov
## 安装插件 ## 安装插件
只支持最新的`jellyfin 10.8.x`版本
添加插件存储库: 添加插件存储库:
国内加速https://mirror.ghproxy.com/https://github.com/cxfksword/jellyfin-plugin-metashark/releases/download/manifest/manifest_cn.json 国内加速https://gitee.com/cwhzy/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
@ -42,7 +40,7 @@ jellyfin电影元数据插件影片信息只要从豆瓣获取并由TheMov
1. Clone or download this repository 1. Clone or download this repository
2. Ensure you have .NET Core SDK 6.0 setup and installed 2. Ensure you have .NET Core SDK 8.0 setup and installed
3. Build plugin with following command. 3. Build plugin with following command.
@ -56,7 +54,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/net6.0/Jellyfin.Plugin.MetaShark.dll` into it 2. Create a folder, like `metashark` and copy `./Jellyfin.Plugin.MetaShark/bin/Release/net8.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.8.0.0', 'targetAbi': '10.9.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')