Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
|
2f44ddf6ec | |
|
f337406ac9 | |
|
cb00027b77 | |
|
9e9074bb5a | |
|
747e69f3bf | |
|
104d200e7b | |
|
8ded89422f | |
|
25a844a2c4 | |
|
f1f35a6d32 | |
|
96be3222f9 | |
|
1b547f7aaf | |
|
408929fc03 | |
|
e26794fdcd | |
|
2eca5c9a22 | |
|
23d10b94ed |
|
@ -13,14 +13,16 @@ assignees: ''
|
|||
|
||||
**屏幕截图**
|
||||
|
||||
如果适用,请添加屏幕截图以帮助解释您的问题。
|
||||
请添加问题截图以帮助解释您的问题。
|
||||
|
||||
**日志**
|
||||
|
||||
请提供jellyfin打印的该影片的刮削日志。
|
||||
|
||||
日志查看方法: 控制台->高级->日志->点击log_yyyymmdd.log格式文件
|
||||
|
||||
**运行环境(请填写以下信息):**
|
||||
|
||||
- 操作系统:[例如 linux]
|
||||
|
||||
- jellyfin 版本:[例如 22]
|
||||
- jellyfin 版本:[例如 10.8.9]
|
||||
- 插件版本:[例如 1.7.1]
|
||||
|
|
|
@ -4,7 +4,7 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
python-version: 3.8
|
||||
project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
|
||||
artifact: metashark
|
||||
|
@ -36,9 +36,9 @@ jobs:
|
|||
- name: Build
|
||||
run: |
|
||||
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
|
||||
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
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
- uses: actions/setup-dotnet@v3
|
||||
id: dotnet
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Change default dotnet version
|
||||
run: |
|
||||
echo '{"sdk":{"version": "${{ steps.dotnet.outputs.dotnet-version }}"}}' > ./global.json
|
||||
|
|
|
@ -5,7 +5,7 @@ on:
|
|||
tags: ["*"]
|
||||
|
||||
env:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
python-version: 3.8
|
||||
project: Jellyfin.Plugin.MetaShark/Jellyfin.Plugin.MetaShark.csproj
|
||||
artifact: metashark
|
||||
|
@ -41,9 +41,9 @@ jobs:
|
|||
- name: Build
|
||||
run: |
|
||||
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
|
||||
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
|
||||
run: python3 ./scripts/generate_manifest.py ./artifacts/${{ env.artifact }}_${{steps.vars.outputs.VERSION}}.zip ${GITHUB_REF#refs/*/}
|
||||
env:
|
||||
|
@ -54,6 +54,7 @@ jobs:
|
|||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: ./artifacts/${{ env.artifact }}_*.zip
|
||||
tag: ${{ github.ref }}
|
||||
release_name: '${{ github.ref_name }}: Jellyfin v10.9'
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
- name: Publish manifest
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageId>AnitomySharp.NET6</PackageId>
|
||||
<PackageVersion>0.4.0</PackageVersion>
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace AnitomySharp
|
|||
"番外編", "總集編","DRAMA",
|
||||
"映像特典","特典","特典アニメ",
|
||||
// 特典 Special 剩下的各种类型可以全部命名成 SP,对于较特殊意义的特典也可以自定义命名
|
||||
"SPECIAL", "SPECIALS", "SP", "SPs",
|
||||
"SPECIAL", "SPECIALS", "SP", "SPs", "特報",
|
||||
// 真人特典 Interview/Talk/Stage... 目前我们对于节目、采访、舞台活动、制作等三次元画面的长视频,一概怼成 IV。
|
||||
"IV",
|
||||
// 音乐视频 Music Video
|
||||
|
@ -85,7 +85,7 @@ namespace AnitomySharp
|
|||
// 无字 OP/ED Non-Credit Opening/Ending
|
||||
"ED", "ENDING", "NCED", "NCOP", "OP", "OPENING",
|
||||
// 预告 Preview 预告下一话内容 注意编号表示其预告的是第几话的内容而不是跟在哪一话后面
|
||||
"PREVIEW", "YOKOKU",
|
||||
"PREVIEW", "YOKOKU", "予告",
|
||||
// 菜单 Menu BD/DVD 播放选择菜单
|
||||
"MENU",
|
||||
// 广告 Commercial Message 电视放送广告,时长一般在 7s/15s/30s/45s/... 左右
|
||||
|
|
|
@ -119,6 +119,29 @@ namespace AnitomySharp
|
|||
if (string.IsNullOrEmpty(str)) return "";
|
||||
return Ordinals.TryGetValue(str, out var foundString) ? foundString : "";
|
||||
}
|
||||
/// <summary>
|
||||
/// 转换原始值中的全角数字
|
||||
/// 1234567890
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetNumberFromFullWidth(string str)
|
||||
{
|
||||
string output = str;
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
if (char.IsDigit(str[i]))
|
||||
{
|
||||
int fullwidthDigit = (int)str[i];
|
||||
if (fullwidthDigit >= 65296 && fullwidthDigit <= 65305)
|
||||
{
|
||||
int halfwidthDigit = fullwidthDigit - 65248;
|
||||
output = output.Replace(str[i], (char)halfwidthDigit);
|
||||
}
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the index of the first digit in the <c>str</c>; -1 otherwise.
|
||||
|
@ -273,7 +296,7 @@ namespace AnitomySharp
|
|||
var prevToken = Token.FindPrevToken(_parser.Tokens, pos, Token.TokenFlag.FlagNotDelimiter);
|
||||
if (!IsTokenCategory(prevToken, Token.TokenCategory.Bracket)) return false;
|
||||
var nextToken = Token.FindNextToken(_parser.Tokens, pos, Token.TokenFlag.FlagNotDelimiter);
|
||||
if (nextToken < 0) return false;
|
||||
if (!Token.InListRange(prevToken, _parser.Tokens) || !Token.InListRange(nextToken, _parser.Tokens)) return false;
|
||||
return KeywordManager.Contains(Element.ElementCategory.ElementAnimeType, _parser.Tokens[nextToken].Content);
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -285,8 +308,8 @@ namespace AnitomySharp
|
|||
{
|
||||
var prevToken = Token.FindPrevToken(_parser.Tokens, pos, Token.TokenFlag.FlagNotDelimiter);
|
||||
var nextToken = Token.FindNextToken(_parser.Tokens, pos, Token.TokenFlag.FlagNotDelimiter);
|
||||
if(!Token.InListRange(prevToken, _parser.Tokens)||!Token.InListRange(nextToken, _parser.Tokens)) return false;
|
||||
if (!IsTokenCategory(nextToken, Token.TokenCategory.Bracket)) return false;
|
||||
if (prevToken < 0) return false;
|
||||
return KeywordManager.Contains(Element.ElementCategory.ElementAnimeType, _parser.Tokens[prevToken].Content);
|
||||
}
|
||||
/// <summary>
|
||||
|
@ -298,8 +321,8 @@ namespace AnitomySharp
|
|||
{
|
||||
var prevToken = Token.FindPrevToken(_parser.Tokens, pos, Token.TokenFlag.FlagNotDelimiter);
|
||||
var nextToken = Token.FindNextToken(_parser.Tokens, pos, Token.TokenFlag.FlagNotDelimiter);
|
||||
if (!Token.InListRange(prevToken, _parser.Tokens) || !Token.InListRange(nextToken, _parser.Tokens)) return false;
|
||||
if (!IsTokenCategory(nextToken, Token.TokenCategory.Bracket)) return false;
|
||||
if (prevToken < 0) return false;
|
||||
return KeywordManager.ContainsInPeekEntries(Element.ElementCategory.ElementAnimeType, _parser.Tokens[prevToken].Content);
|
||||
}
|
||||
|
||||
|
|
|
@ -513,7 +513,8 @@ namespace AnitomySharp
|
|||
return true;
|
||||
}
|
||||
|
||||
regexPattern = @"([第全]?)([0-9一二三四五六七八九十壱弐参]+)([期章話话巻卷幕夜期発縛])";
|
||||
// 全角数字:\uFF10-\uFF19
|
||||
regexPattern = @"([第全]?)([0-9一二三四五六七八九十壱弐参\uFF10-\uFF19]+)([回集話话幕夜発縛])";
|
||||
match = Regex.Match(word, RegexMatchOnlyStart + regexPattern + RegexMatchOnlyEnd, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
|
@ -522,11 +523,33 @@ namespace AnitomySharp
|
|||
{
|
||||
episodeNumber = ParserHelper.GetNumberFromOrdinal(episodeNumber);
|
||||
}
|
||||
episodeNumber = ParserHelper.GetNumberFromFullWidth(episodeNumber);
|
||||
SetEpisodeNumber(episodeNumber, token, false);
|
||||
return true;
|
||||
}
|
||||
regexPattern = @"([第全]?)([0-9一二三四五六七八九十壱弐参\uFF10-\uFF19]+)([期章巻卷])";
|
||||
match = Regex.Match(word, RegexMatchOnlyStart + regexPattern + RegexMatchOnlyEnd, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
var episodeNumber = match.Groups[2].Value;
|
||||
if (!StringHelper.IsNumericString(episodeNumber))
|
||||
{
|
||||
episodeNumber = ParserHelper.GetNumberFromOrdinal(episodeNumber);
|
||||
}
|
||||
episodeNumber = ParserHelper.GetNumberFromFullWidth(episodeNumber);
|
||||
SetEpisodeNumber(episodeNumber, token, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
regexPattern = @"(vol|EPISODE|ACT|scene|ep|volume|screen|voice|case|menu|rail|round|game|page|collection|cage|office|doll|Princess)([ \.\-_])([0-9]+)";
|
||||
regexPattern = @"(EPISODE|ACT|scene|ep|screen|voice|case|menu|rail|round|game|page|collection|cage|office|doll|Princess)([ \.\-_])([0-9]+)";
|
||||
match = Regex.Match(word, RegexMatchOnlyStart + regexPattern + RegexMatchOnlyEnd, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
var episodeNumber = match.Groups[3].Value;
|
||||
SetEpisodeNumber(episodeNumber, token, false);
|
||||
return true;
|
||||
}
|
||||
regexPattern = @"(vol|volume)([ \.\-_])([0-9]+)";
|
||||
match = Regex.Match(word, RegexMatchOnlyStart + regexPattern + RegexMatchOnlyEnd, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
|
|
@ -167,23 +167,36 @@ namespace Jellyfin.Plugin.MetaShark.Test
|
|||
[TestMethod]
|
||||
public void TestEposideParse()
|
||||
{
|
||||
// 普通数字
|
||||
var fileName = "03.mp4";
|
||||
var parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "03");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 3);
|
||||
|
||||
fileName = "03 4K.mp4";
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "03");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 3);
|
||||
|
||||
// 混合中英文
|
||||
var fileName = "新世界.New.World.2013.BluRay.1080p.x265.10bit.MNHD-FRDS";
|
||||
var parseResult = NameParser.Parse(fileName);
|
||||
fileName = "新世界.New.World.2013.BluRay.1080p.x265.10bit.MNHD-FRDS";
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.ChineseName, "新世界");
|
||||
Assert.AreEqual(parseResult.Name, "New World");
|
||||
Assert.AreEqual(parseResult.Year, 2013);
|
||||
|
||||
// 只英文 S01E01
|
||||
fileName = "She-Hulk.Attorney.At.Law.S01E01.1080p.WEBRip.x265-RARBG";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "She-Hulk Attorney At Law");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, 1);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 1);
|
||||
|
||||
// 测试 SXXEPXX 格式
|
||||
fileName = "神探狄仁杰2 Detective.Dee.Ⅱ.S02EP02.2006.2160p.WEB-DL.x264.AAC-HQC";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.ChineseName, "神探狄仁杰2");
|
||||
Assert.AreEqual(parseResult.Name, "Detective Dee Ⅱ");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, 2);
|
||||
|
@ -192,26 +205,26 @@ namespace Jellyfin.Plugin.MetaShark.Test
|
|||
|
||||
// 日文
|
||||
fileName = "プロポーズ大作戦Ep05_x264.mp4";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "プロポーズ大作戦Ep05");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 5);
|
||||
|
||||
fileName = "[01] [ANK-Raws] あっちこっち 01 (BDrip 1920x1080 HEVC-YUV420P10 FLAC)";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "あっちこっち 01");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 1);
|
||||
|
||||
// 只中文
|
||||
fileName = "齊天大聖 第02集";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "齊天大聖 第02集");
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "齊天大聖");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 2);
|
||||
|
||||
fileName = "齊天大聖 第 02 期";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "齊天大聖");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 2);
|
||||
|
@ -219,38 +232,40 @@ namespace Jellyfin.Plugin.MetaShark.Test
|
|||
|
||||
// anime
|
||||
fileName = "[YYDM-11FANS][THERMAE_ROMAE][02][BDRIP][720P][X264-10bit_AAC][7FF2269F]";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "THERMAE ROMAE");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 2);
|
||||
|
||||
// anime带季数
|
||||
fileName = "[WMSUB][Detective Conan - Zero‘s Tea Time ][S01][E06][BIG5][1080P].mp4";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "Detective Conan - Zero‘s Tea Time");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, 1);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 6);
|
||||
|
||||
fileName = "[KTXP][Machikado_Mazoku_S2][01][BIG5][1080p]";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "Machikado Mazoku");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 1);
|
||||
|
||||
fileName = "[異域字幕組][她和她的貓 - Everything Flows -][She and Her Cat - Everything Flows -][01][720p][繁體]";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.AreEqual(parseResult.Name, "她和她的貓 - Everything Flows");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, 1);
|
||||
|
||||
// anime特典
|
||||
fileName = "[KissSub][Steins;Gate][SP][GB_BIG5_JP][BDrip][1080P][HEVC] 边界曲面的缺失之环";
|
||||
parseResult = NameParser.Parse(fileName);
|
||||
parseResult = NameParser.ParseEpisode(fileName);
|
||||
Assert.IsTrue(parseResult.IsSpecial);
|
||||
Assert.AreEqual(parseResult.Name, "边界曲面的缺失之环");
|
||||
Assert.AreEqual(parseResult.ParentIndexNumber, null);
|
||||
Assert.AreEqual(parseResult.IndexNumber, null);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,11 @@ namespace Jellyfin.Plugin.MetaShark.Test
|
|||
var imdbApi = new ImdbApi(loggerFactory);
|
||||
|
||||
var provider = new SeasonProvider(httpClientFactory, loggerFactory, libraryManagerStub.Object, httpContextAccessorStub.Object, doubanApi, tmdbApi, omdbApi, imdbApi);
|
||||
var result = provider.GuessSeasonNumberByDirectoryName("/data/downloads/jellyfin/tv/向往的生活/第2季");
|
||||
|
||||
var result = provider.GuessSeasonNumberByDirectoryName("/data/downloads/jellyfin/tv/冰与火之歌S01-S08.Game.of.Thrones.1080p.Blu-ray.x265.10bit.AC3/冰与火之歌S2.列王的纷争.2012.1080p.Blu-ray.x265.10bit.AC3");
|
||||
Assert.AreEqual(result, 2);
|
||||
|
||||
result = provider.GuessSeasonNumberByDirectoryName("/data/downloads/jellyfin/tv/向往的生活/第2季");
|
||||
Assert.AreEqual(result, 2);
|
||||
|
||||
result = provider.GuessSeasonNumberByDirectoryName("/data/downloads/jellyfin/tv/向往的生活 第2季");
|
||||
|
|
|
@ -8,6 +8,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using TMDbLib.Objects.Find;
|
||||
using TMDbLib.Objects.Languages;
|
||||
|
||||
namespace Jellyfin.Plugin.MetaShark.Test
|
||||
|
@ -124,5 +125,27 @@ namespace Jellyfin.Plugin.MetaShark.Test
|
|||
}).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void TestFindByExternalId()
|
||||
{
|
||||
var api = new TmdbApi(loggerFactory);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = await api.FindByExternalIdAsync("tt5924366", FindExternalSource.Imdb, "zh", CancellationToken.None)
|
||||
.ConfigureAwait(false);
|
||||
Assert.IsNotNull(result);
|
||||
TestContext.WriteLine(result.ToJson());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TestContext.WriteLine(ex.Message);
|
||||
}
|
||||
}).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,18 +52,10 @@ namespace Jellyfin.Plugin.MetaShark.Api
|
|||
Regex regSubname = new Regex(@"又名: (.+?)\n", RegexOptions.Compiled);
|
||||
Regex regImdb = new Regex(@"IMDb: (tt\d+)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
Regex regSite = new Regex(@"官方网站: (.+?)\n", RegexOptions.Compiled);
|
||||
Regex regNameMath = new Regex(@"(.+第\w季|[\w\uff1a\uff01\uff0c\u00b7]+)\s*(.*)", RegexOptions.Compiled);
|
||||
Regex regRole = new Regex(@"\([饰|配]?\s*?(.+?)\)", RegexOptions.Compiled);
|
||||
Regex regBackgroundImage = new Regex(@"url\(([^)]+?)\)$", RegexOptions.Compiled);
|
||||
Regex regGender = new Regex(@"性别: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regConstellation = new Regex(@"星座: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regBirthdate = new Regex(@"出生日期: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regLifedate = new Regex(@"生卒日期: \n(.+?) 至 (.+)", RegexOptions.Compiled);
|
||||
Regex regBirthplace = new Regex(@"出生地: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regCelebrityRole = new Regex(@"职业: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regNickname = new Regex(@"更多外文名: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regFamily = new Regex(@"家庭成员: \n(.+?)\n", RegexOptions.Compiled);
|
||||
Regex regCelebrityImdb = new Regex(@"imdb编号:\s+?(nm\d+)", RegexOptions.Compiled);
|
||||
Regex regLifedate = new Regex(@"(.+?) 至 (.+)", RegexOptions.Compiled);
|
||||
Regex regHtmlTag = new Regex(@"<.?>", RegexOptions.Compiled);
|
||||
Regex regImgHost = new Regex(@"\/\/(img\d+?)\.", RegexOptions.Compiled);
|
||||
// 匹配除了换行符之外所有空白
|
||||
Regex regOverviewSpace = new Regex(@"\n[^\S\n]+", RegexOptions.Compiled);
|
||||
|
@ -90,7 +82,7 @@ namespace Jellyfin.Plugin.MetaShark.Api
|
|||
var handler = new HttpClientHandlerEx();
|
||||
this._cookieContainer = handler.CookieContainer;
|
||||
httpClient = new HttpClient(handler);
|
||||
httpClient.Timeout = TimeSpan.FromSeconds(10);
|
||||
httpClient.Timeout = TimeSpan.FromSeconds(20);
|
||||
httpClient.DefaultRequestHeaders.Add("User-Agent", HTTP_USER_AGENT);
|
||||
httpClient.DefaultRequestHeaders.Add("Origin", "https://movie.douban.com");
|
||||
httpClient.DefaultRequestHeaders.Add("Referer", "https://movie.douban.com/");
|
||||
|
@ -519,48 +511,64 @@ namespace Jellyfin.Plugin.MetaShark.Api
|
|||
var contentNode = doc.QuerySelector("#content");
|
||||
if (contentNode != null)
|
||||
{
|
||||
var img = contentNode.GetAttr("#headline .nbg img", "src") ?? string.Empty;
|
||||
var nameStr = contentNode.GetText("h1") ?? string.Empty;
|
||||
var name = this.ParseCelebrityName(nameStr);
|
||||
var englishName = nameStr.Replace(name, "").Trim();
|
||||
celebrity.Img = contentNode.GetAttr("img.avatar", "src") ?? string.Empty;
|
||||
var nameStr = contentNode.GetText("h1.subject-name") ?? string.Empty;
|
||||
celebrity.Name = this.ParseCelebrityName(nameStr);
|
||||
celebrity.EnglishName = nameStr.Replace(celebrity.Name, "").Trim();
|
||||
|
||||
var intro = contentNode.GetText("#intro span.all") ?? string.Empty;
|
||||
if (string.IsNullOrEmpty(intro))
|
||||
|
||||
var family = string.Empty;
|
||||
var propertyNodes = contentNode.QuerySelectorAll("ul.subject-property>li");
|
||||
foreach (var li in propertyNodes)
|
||||
{
|
||||
intro = contentNode.GetText("#intro div.bd") ?? string.Empty;
|
||||
}
|
||||
var info = contentNode.GetText("div.info") ?? string.Empty;
|
||||
var gender = info.GetMatchGroup(this.regGender);
|
||||
var constellation = info.GetMatchGroup(this.regConstellation);
|
||||
var birthdate = info.GetMatchGroup(this.regBirthdate);
|
||||
|
||||
// 生卒日期
|
||||
var enddate = string.Empty;
|
||||
var match = this.regLifedate.Match(info);
|
||||
var label = li.GetText("span.label") ?? string.Empty;
|
||||
var value = li.GetText("span.value") ?? string.Empty;
|
||||
switch (label)
|
||||
{
|
||||
case "性别:":
|
||||
celebrity.Gender = value;
|
||||
break;
|
||||
case "星座:":
|
||||
celebrity.Constellation = value;
|
||||
break;
|
||||
case "出生日期:":
|
||||
celebrity.Birthdate = value;
|
||||
break;
|
||||
case "去世日期:":
|
||||
celebrity.Enddate = value;
|
||||
break;
|
||||
case "生卒日期:":
|
||||
var match = this.regLifedate.Match(value);
|
||||
if (match.Success && match.Groups.Count > 2)
|
||||
{
|
||||
birthdate = match.Groups[1].Value.Trim();
|
||||
enddate = match.Groups[2].Value.Trim();
|
||||
celebrity.Birthdate = match.Groups[1].Value.Trim();
|
||||
celebrity.Enddate = match.Groups[2].Value.Trim();
|
||||
}
|
||||
break;
|
||||
case "出生地:":
|
||||
celebrity.Birthplace = value;
|
||||
break;
|
||||
case "职业:":
|
||||
celebrity.Role = value;
|
||||
break;
|
||||
case "更多外文名:":
|
||||
celebrity.NickName = value;
|
||||
break;
|
||||
case "家庭成员:":
|
||||
family = value;
|
||||
break;
|
||||
case "IMDb编号:":
|
||||
celebrity.Imdb = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var birthplace = info.GetMatchGroup(this.regBirthplace);
|
||||
var role = info.GetMatchGroup(this.regCelebrityRole);
|
||||
var nickname = info.GetMatchGroup(this.regNickname);
|
||||
var family = info.GetMatchGroup(this.regFamily);
|
||||
var imdb = info.GetMatchGroup(this.regCelebrityImdb);
|
||||
|
||||
celebrity.Img = img;
|
||||
celebrity.Gender = gender;
|
||||
celebrity.Birthdate = birthdate;
|
||||
celebrity.Enddate = enddate;
|
||||
celebrity.NickName = nickname;
|
||||
celebrity.EnglishName = englishName;
|
||||
celebrity.Imdb = imdb;
|
||||
celebrity.Birthplace = birthplace;
|
||||
celebrity.Name = name;
|
||||
// 保留段落关系,把段落替换为换行符
|
||||
var intro = contentNode.GetHtml("section.subject-intro div.content") ?? string.Empty;
|
||||
intro = regHtmlTag.Replace(intro.Replace("</p>", "\n"), "");
|
||||
celebrity.Intro = formatOverview(intro);
|
||||
celebrity.Constellation = constellation;
|
||||
celebrity.Role = role;
|
||||
_memoryCache.Set<DoubanCelebrity?>(cacheKey, celebrity, expiredOption);
|
||||
return celebrity;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,17 @@ namespace Jellyfin.Plugin.MetaShark.Core
|
|||
return null;
|
||||
}
|
||||
|
||||
public static string? GetHtml(this IElement el, string css)
|
||||
{
|
||||
var node = el.QuerySelector(css);
|
||||
if (node != null)
|
||||
{
|
||||
return node.Html().Trim();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetTextOrDefault(this IElement el, string css, string defaultVal = "")
|
||||
{
|
||||
var node = el.QuerySelector(css);
|
||||
|
|
|
@ -118,6 +118,15 @@ namespace Jellyfin.Plugin.MetaShark.Core
|
|||
}
|
||||
}
|
||||
|
||||
// 假如 Anitomy 解析不到集数,判断 name 是否是数字集号
|
||||
if (parseResult.IndexNumber is null && isEpisode)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(parseResult.Name) && parseResult.Name.IsNumericString())
|
||||
{
|
||||
parseResult.IndexNumber = parseResult.Name.ToInt();
|
||||
}
|
||||
}
|
||||
|
||||
// 修复纯中文集数/特殊标识集数
|
||||
if (parseResult.IndexNumber is null)
|
||||
{
|
||||
|
@ -133,6 +142,11 @@ namespace Jellyfin.Plugin.MetaShark.Core
|
|||
return parseResult;
|
||||
}
|
||||
|
||||
public static ParseNameResult ParseEpisode(string fileName)
|
||||
{
|
||||
return Parse(fileName, true);
|
||||
}
|
||||
|
||||
private static string CleanName(string name)
|
||||
{
|
||||
// 电视剧名称后紧跟季信息时,会附加到名称中,需要去掉
|
||||
|
@ -173,9 +187,11 @@ namespace Jellyfin.Plugin.MetaShark.Core
|
|||
/// </summary>
|
||||
public static EpisodePathParserResult ParseEpisodeByDefault(string fileName)
|
||||
{
|
||||
// EpisodePathParser需要路径信息, 这里添加一个分隔符模拟路径
|
||||
var path = Path.DirectorySeparatorChar + fileName;
|
||||
var nameOptions = new Emby.Naming.Common.NamingOptions();
|
||||
return new EpisodePathParser(nameOptions)
|
||||
.Parse(fileName, false);
|
||||
.Parse(path, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -230,15 +246,21 @@ namespace Jellyfin.Plugin.MetaShark.Core
|
|||
return null;
|
||||
}
|
||||
|
||||
public static bool IsSpecialDirectory(string path)
|
||||
public static bool IsSpecialDirectory(string path, bool isDirectory = false)
|
||||
{
|
||||
var folder = Path.GetFileName(Path.GetDirectoryName(path))?.ToUpper() ?? string.Empty;
|
||||
return folder == "SPS" || folder == "SPECIALS" || folder.Contains("特典");
|
||||
if (isDirectory) {
|
||||
folder = Path.GetFileName(path)?.ToUpper() ?? string.Empty;
|
||||
}
|
||||
return folder == "SP" || folder == "SPS" || folder == "SPECIALS" || folder.Contains("特典");
|
||||
}
|
||||
|
||||
public static bool IsExtraDirectory(string path)
|
||||
public static bool IsExtraDirectory(string path, bool isDirectory = false)
|
||||
{
|
||||
var folder = Path.GetFileName(Path.GetDirectoryName(path))?.ToUpper() ?? string.Empty;
|
||||
if (isDirectory) {
|
||||
folder = Path.GetFileName(path)?.ToUpper() ?? string.Empty;
|
||||
}
|
||||
return folder == "EXTRA"
|
||||
|| folder == "MENU"
|
||||
|| folder == "MENUS"
|
||||
|
|
|
@ -78,5 +78,10 @@ namespace Jellyfin.Plugin.MetaShark.Core
|
|||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static bool IsNumericString(this string str)
|
||||
{
|
||||
return str.All(char.IsDigit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>Jellyfin.Plugin.MetaShark</RootNamespace>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
|
@ -21,11 +21,14 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AngleSharp" Version="1.0.1" />
|
||||
<PackageReference Include="ILRepack.Lib.MSBuild.Minor" Version="2.1.19-alpha.2" />
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.8.0" />
|
||||
<PackageReference Include="Jellyfin.Model" Version="10.8.0" />
|
||||
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.32">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<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="TMDbLib" Version="2.0.0" />
|
||||
<PackageReference Include="TMDbLib" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
|
||||
|
|
|
@ -19,6 +19,7 @@ using TMDbLib.Objects.General;
|
|||
using Jellyfin.Plugin.MetaShark.Configuration;
|
||||
using Jellyfin.Plugin.MetaShark.Core;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
|
||||
namespace Jellyfin.Plugin.MetaShark.Providers
|
||||
{
|
||||
|
@ -50,6 +51,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
|
||||
protected Regex regMetaSourcePrefix = new Regex(@"^\[.+\]", RegexOptions.Compiled);
|
||||
protected Regex regSeasonNameSuffix = new Regex(@"\s第[0-9一二三四五六七八九十]+?季$|\sSeason\s\d+?$|(?<![0-9a-zA-Z])\d$", RegexOptions.Compiled);
|
||||
protected Regex regDoubanIdAttribute = new Regex(@"\[(?:douban|doubanid)-(\d+?)\]", RegexOptions.Compiled);
|
||||
|
||||
protected PluginConfiguration config
|
||||
{
|
||||
|
@ -107,11 +109,17 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
protected async Task<string?> GuessByDoubanAsync(ItemLookupInfo info, CancellationToken cancellationToken)
|
||||
{
|
||||
var fileName = GetOriginalFileName(info);
|
||||
// 从文件名属性格式获取,如[douban-12345]或[doubanid-12345]
|
||||
var doubanId = this.regDoubanIdAttribute.FirstMatchGroup(fileName);
|
||||
if (!string.IsNullOrWhiteSpace(doubanId))
|
||||
{
|
||||
this.Log($"Found douban [id] by attr: {doubanId}");
|
||||
return doubanId;
|
||||
}
|
||||
var parseResult = NameParser.Parse(fileName);
|
||||
var searchName = !string.IsNullOrEmpty(parseResult.ChineseName) ? parseResult.ChineseName : parseResult.Name;
|
||||
info.Year = parseResult.Year; // 默认parser对anime年份会解析出错,以anitomy为准
|
||||
|
||||
|
||||
this.Log($"GuessByDouban of [name]: {info.Name} [file_name]: {fileName} [year]: {info.Year} [search name]: {searchName}");
|
||||
List<DoubanSubject> result;
|
||||
DoubanSubject? item;
|
||||
|
@ -125,13 +133,13 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
item = result.Where(x => x.Year == info.Year && x.Name == searchName).FirstOrDefault();
|
||||
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;
|
||||
}
|
||||
item = result.Where(x => x.Year == info.Year).FirstOrDefault();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +177,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
item = result.Where(x => x.Category == cat).FirstOrDefault();
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -351,6 +359,18 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
this.Log($"Found tmdb [id]: {tmdbId} by imdb id: {imdb}");
|
||||
return $"{tmdbId}";
|
||||
}
|
||||
if (findResult?.TvEpisode != null && findResult.TvEpisode.Count > 0)
|
||||
{
|
||||
var tmdbId = findResult.TvEpisode[0].ShowId;
|
||||
this.Log($"Found tmdb [id]: {tmdbId} by imdb id: {imdb}");
|
||||
return $"{tmdbId}";
|
||||
}
|
||||
if (findResult?.TvSeason != null && findResult.TvSeason.Count > 0)
|
||||
{
|
||||
var tmdbId = findResult.TvSeason[0].ShowId;
|
||||
this.Log($"Found tmdb [id]: {tmdbId} by imdb id: {imdb}");
|
||||
return $"{tmdbId}";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -383,9 +403,10 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
public int? GuessSeasonNumberByDirectoryName(string path)
|
||||
{
|
||||
// TODO: 有时 series name 中会带有季信息
|
||||
// 当没有season级目录时,path为空,直接返回
|
||||
// 当没有 season 级目录时,或 season 文件夹特殊不规范命名时,会解析不到 seasonNumber,这时 path 为空,直接返回
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
this.Log($"Season path is empty!");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -396,6 +417,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
return null;
|
||||
}
|
||||
|
||||
// 中文季名
|
||||
var regSeason = new Regex(@"第([0-9零一二三四五六七八九]+?)(季|部)", RegexOptions.Compiled);
|
||||
var match = regSeason.Match(fileName);
|
||||
if (match.Success && match.Groups.Count > 1)
|
||||
|
@ -412,12 +434,26 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
}
|
||||
}
|
||||
|
||||
// SXX 季名
|
||||
regSeason = new Regex(@"(?<![a-z])S(\d\d?)(?![0-9a-z])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
match = regSeason.Match(fileName);
|
||||
if (match.Success && match.Groups.Count > 1)
|
||||
{
|
||||
var seasonNumber = match.Groups[1].Value.ToInt();
|
||||
if (seasonNumber > 0)
|
||||
{
|
||||
this.Log($"Found season number of filename: {fileName} seasonNumber: {seasonNumber}");
|
||||
return seasonNumber;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 动漫季特殊命名
|
||||
var seasonNameMap = new Dictionary<string, int>() {
|
||||
{@"[ ._](I|1st|S01|S1)[ ._]", 1},
|
||||
{@"[ ._](II|2nd|S02|S2)[ ._]", 2},
|
||||
{@"[ ._](III|3rd|S03|S3)[ ._]", 3},
|
||||
{@"[ ._](IIII|4th|S04|S4)[ ._]", 3},
|
||||
{@"[ ._](I|1st)[ ._]", 1},
|
||||
{@"[ ._](II|2nd)[ ._]", 2},
|
||||
{@"[ ._](III|3rd)[ ._]", 3},
|
||||
{@"[ ._](IIII|4th)[ ._]", 3},
|
||||
};
|
||||
|
||||
foreach (var entry in seasonNameMap)
|
||||
|
@ -587,7 +623,47 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
}
|
||||
}
|
||||
|
||||
protected string RemoveSeasonSubfix(string name)
|
||||
protected string? GetOriginalSeasonPath(EpisodeInfo info)
|
||||
{
|
||||
if (info.Path == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var seasonPath = Path.GetDirectoryName(info.Path);
|
||||
var item = this._libraryManager.FindByPath(seasonPath, true);
|
||||
// 没有季文件夹
|
||||
if (item is Series) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return seasonPath;
|
||||
}
|
||||
|
||||
protected bool IsVirtualSeason(EpisodeInfo info)
|
||||
{
|
||||
if (info.Path == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var seasonPath = Path.GetDirectoryName(info.Path);
|
||||
var parent = this._libraryManager.FindByPath(seasonPath, true);
|
||||
// 没有季文件夹
|
||||
if (parent is Series) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var seriesPath = Path.GetDirectoryName(seasonPath);
|
||||
var series = this._libraryManager.FindByPath(seriesPath, true);
|
||||
// 季文件夹不规范,没法识别
|
||||
if (series is Series && parent is not Season) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected string RemoveSeasonSuffix(string name)
|
||||
{
|
||||
return regSeasonNameSuffix.Replace(name, "");
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
// 识别:info的Name、IndexNumber和ParentIndexNumber是从文件名解析出来的,provinceIds有指定选择项的ProvinceId
|
||||
// 覆盖所有元数据:info的Name、IndexNumber和ParentIndexNumber是从文件名解析出来的,provinceIds保留所有旧值
|
||||
// 搜索缺少的元数据:info的Name、IndexNumber和ParentIndexNumber是从当前的元数据获取,provinceIds保留所有旧值
|
||||
this.Log($"GetEpisodeMetadata of [name]: {info.Name} number: {info.IndexNumber} ParentIndexNumber: {info.ParentIndexNumber} IsAutomated: {info.IsAutomated}");
|
||||
var fileName = Path.GetFileName(info.Path);
|
||||
this.Log($"GetEpisodeMetadata of [name]: {info.Name} [fileName]: {fileName} number: {info.IndexNumber} ParentIndexNumber: {info.ParentIndexNumber} EnableTmdb: {config.EnableTmdb}");
|
||||
var result = new MetadataResult<Episode>();
|
||||
|
||||
// 动画特典和extras处理
|
||||
|
@ -135,77 +136,66 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
// 使用 AnitomySharp 进行重新解析,解决 anime 识别错误
|
||||
var fileName = Path.GetFileNameWithoutExtension(info.Path) ?? info.Name;
|
||||
var parseResult = NameParser.Parse(fileName);
|
||||
var parseResult = NameParser.ParseEpisode(fileName);
|
||||
info.Year = parseResult.Year;
|
||||
info.Name = parseResult.ChineseName ?? parseResult.Name;
|
||||
|
||||
// 文件名带有季数数据时,从文件名解析出季数进行修正
|
||||
// 修正文件名有特殊命名 SXXEPXX 时,默认解析到错误季数的问题,如神探狄仁杰 Detective.Dee.S01EP01.2006.2160p.WEB-DL.x264.AAC-HQC
|
||||
// TODO: 会导致覆盖用户手动修改元数据的季数
|
||||
if (info.ParentIndexNumber.HasValue && parseResult.ParentIndexNumber.HasValue && parseResult.ParentIndexNumber > 0 && info.ParentIndexNumber != parseResult.ParentIndexNumber)
|
||||
if (parseResult.ParentIndexNumber.HasValue && parseResult.ParentIndexNumber > 0 && info.ParentIndexNumber != parseResult.ParentIndexNumber)
|
||||
{
|
||||
this.Log("FixSeasonNumber by anitomy. old: {0} new: {1}", info.ParentIndexNumber, parseResult.ParentIndexNumber);
|
||||
info.ParentIndexNumber = parseResult.ParentIndexNumber;
|
||||
}
|
||||
|
||||
// 没有season级目录(即虚拟季)ParentIndexNumber默认是1,季文件夹命名不规范时,ParentIndexNumber默认是null
|
||||
if (info.ParentIndexNumber is null)
|
||||
{
|
||||
info.ParentIndexNumber = parseResult.ParentIndexNumber;
|
||||
}
|
||||
|
||||
// 修正anime命名格式导致的seasonNumber错误(从season元数据读取)
|
||||
if (info.ParentIndexNumber is null)
|
||||
{
|
||||
var episodeItem = _libraryManager.FindByPath(info.Path, false);
|
||||
var season = episodeItem != null ? ((Episode)episodeItem).Season : null;
|
||||
if (season != null && season.IndexNumber.HasValue && info.ParentIndexNumber != season.IndexNumber)
|
||||
{
|
||||
this.Log("FixSeasonNumber by season. old: {0} new: {1}", info.ParentIndexNumber, season.IndexNumber);
|
||||
info.ParentIndexNumber = season.IndexNumber;
|
||||
}
|
||||
|
||||
// // 当没有season级目录时,默认为1,即当成只有一季(不需要处理,虚拟季jellyfin默认传的ParentIndexNumber=1)
|
||||
// if (info.ParentIndexNumber is null && season != null && season.LocationType == LocationType.Virtual)
|
||||
// // 修正anime命名格式导致的seasonNumber错误(从season元数据读取)
|
||||
// if (info.ParentIndexNumber is null)
|
||||
// {
|
||||
// this.Log("FixSeasonNumber: season is virtual, set to default 1");
|
||||
// info.ParentIndexNumber = 1;
|
||||
// var episodeItem = this._libraryManager.FindByPath(info.Path, false);
|
||||
// var season = episodeItem != null ? ((Episode)episodeItem).Season : null;
|
||||
// if (season != null && season.IndexNumber.HasValue && info.ParentIndexNumber != season.IndexNumber)
|
||||
// {
|
||||
// info.ParentIndexNumber = season.IndexNumber;
|
||||
// this.Log("FixSeasonNumber by season. old: {0} new: {1}", info.ParentIndexNumber, season.IndexNumber);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// 从季文件夹名称猜出 season number
|
||||
var seasonFolderPath = Path.GetDirectoryName(info.Path);
|
||||
if (info.ParentIndexNumber is null && seasonFolderPath != null)
|
||||
// 没有 season 级目录或部分特殊不规范命名,会变成虚拟季,ParentIndexNumber 默认设为 1
|
||||
// https://github.com/jellyfin/jellyfin/blob/926470829d91d93b4c0b22c5b8b89a791abbb434/Emby.Server.Implementations/Library/LibraryManager.cs#L2626
|
||||
var isVirtualSeason = this.IsVirtualSeason(info);
|
||||
var seasonFolderPath = this.GetOriginalSeasonPath(info);
|
||||
if (info.ParentIndexNumber is null or 1 && isVirtualSeason && seasonFolderPath != null)
|
||||
{
|
||||
info.ParentIndexNumber = this.GuessSeasonNumberByDirectoryName(seasonFolderPath);
|
||||
var guestSeasonNumber = this.GuessSeasonNumberByDirectoryName(seasonFolderPath);
|
||||
if (guestSeasonNumber.HasValue && guestSeasonNumber != info.ParentIndexNumber)
|
||||
{
|
||||
this.Log("FixSeasonNumber by season path. old: {0} new: {1}", info.ParentIndexNumber, guestSeasonNumber);
|
||||
info.ParentIndexNumber = guestSeasonNumber;
|
||||
}
|
||||
}
|
||||
|
||||
// 识别特典
|
||||
if (info.ParentIndexNumber is null && NameParser.IsAnime(fileName) && (parseResult.IsSpecial || NameParser.IsSpecialDirectory(info.Path)))
|
||||
{
|
||||
this.Log("FixSeasonNumber to special. old: {0} new: 0", info.ParentIndexNumber);
|
||||
info.ParentIndexNumber = 0;
|
||||
}
|
||||
|
||||
// // 设为默认季数为1(问题:当同时存在S01和剧场版季文件夹时,剧场版的影片会因为默认第一季而在S01也显示出来)
|
||||
// if (info.ParentIndexNumber is null)
|
||||
// {
|
||||
// this.Log("FixSeasonNumber: season number is null, set to default 1");
|
||||
// info.ParentIndexNumber = 1;
|
||||
// }
|
||||
|
||||
// 特典优先使用文件名(特典除了前面特别设置,还有 SXX/Season XX 等默认的)
|
||||
if (info.ParentIndexNumber.HasValue && info.ParentIndexNumber == 0)
|
||||
{
|
||||
info.Name = parseResult.SpecialName == info.Name ? fileName : parseResult.SpecialName;
|
||||
}
|
||||
|
||||
// 大于1000,可能错误解析了分辨率
|
||||
if (parseResult.IndexNumber.HasValue && parseResult.IndexNumber < 1000 && info.IndexNumber != parseResult.IndexNumber)
|
||||
// 修正 episode number
|
||||
if (parseResult.IndexNumber.HasValue && info.IndexNumber != parseResult.IndexNumber)
|
||||
{
|
||||
this.Log("FixEpisodeNumber by anitomy. old: {0} new: {1}", info.IndexNumber, parseResult.IndexNumber);
|
||||
info.IndexNumber = parseResult.IndexNumber;
|
||||
}
|
||||
|
||||
this.Log("FixParseInfo: fileName: {0} seasonNumber: {1} episodeNumber: {2} name: {3}", fileName, info.ParentIndexNumber, info.IndexNumber, info.Name);
|
||||
return info;
|
||||
}
|
||||
|
||||
|
@ -214,7 +204,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
// 特典或extra视频可能和正片剧集放在同一目录
|
||||
var fileName = Path.GetFileNameWithoutExtension(info.Path) ?? info.Name;
|
||||
var parseResult = NameParser.Parse(fileName);
|
||||
var parseResult = NameParser.ParseEpisode(fileName);
|
||||
if (parseResult.IsExtra)
|
||||
{
|
||||
this.Log($"Found anime extra of [name]: {fileName}");
|
||||
|
@ -241,7 +231,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
return result;
|
||||
}
|
||||
|
||||
//// 特典也有剧集信息,不在这里处理
|
||||
//// 特典也有 tmdb 剧集信息,不在这里处理
|
||||
// if (parseResult.IsSpecial || NameParser.IsSpecialDirectory(info.Path))
|
||||
// {
|
||||
// this.Log($"Found anime sp of [name]: {fileName}");
|
||||
|
|
|
@ -7,6 +7,7 @@ using System.Net.Http;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AngleSharp.Text;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.MetaShark.Api;
|
||||
using Jellyfin.Plugin.MetaShark.Core;
|
||||
using Jellyfin.Plugin.MetaShark.Model;
|
||||
|
@ -83,7 +84,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
public async Task<MetadataResult<Movie>> GetMetadata(MovieInfo info, CancellationToken cancellationToken)
|
||||
{
|
||||
var fileName = this.GetOriginalFileName(info);
|
||||
this.Log($"GetMovieMetadata of [name]: {info.Name} [fileName]: {fileName} IsAutomated: {info.IsAutomated}");
|
||||
this.Log($"GetMovieMetadata of [name]: {info.Name} [fileName]: {fileName} EnableTmdb: {config.EnableTmdb}");
|
||||
var result = new MetadataResult<Movie>();
|
||||
|
||||
// 使用刷新元数据时,providerIds会保留旧有值,只有识别/新增才会没值
|
||||
|
@ -182,7 +183,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo
|
||||
{
|
||||
Name = c.Name,
|
||||
Type = c.RoleType,
|
||||
Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor,
|
||||
Role = c.Role,
|
||||
ImageUrl = this.GetLocalProxyImageUrl(c.Img),
|
||||
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } },
|
||||
|
@ -301,7 +302,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
Name = actor.Name.Trim(),
|
||||
Role = actor.Character,
|
||||
Type = PersonType.Actor,
|
||||
Type = PersonKind.Actor,
|
||||
SortOrder = actor.Order,
|
||||
};
|
||||
|
||||
|
@ -344,7 +345,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
Name = person.Name.Trim(),
|
||||
Role = person.Job,
|
||||
Type = type
|
||||
Type = type == PersonType.Director ? PersonKind.Director : (type == PersonType.Producer ? PersonKind.Producer : PersonKind.Actor),
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(person.ProfilePath))
|
||||
|
|
|
@ -120,8 +120,9 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
var findResult = await this._tmdbApi.FindByExternalIdAsync(c.Imdb, FindExternalSource.Imdb, info.MetadataLanguage, cancellationToken).ConfigureAwait(false);
|
||||
if (findResult?.PersonResults != null && findResult.PersonResults.Count > 0)
|
||||
{
|
||||
this.Log($"GetPersonMetadata of found tmdb [id]: {findResult.PersonResults[0].Id}");
|
||||
item.SetProviderId(MetadataProvider.Tmdb, $"{findResult.PersonResults[0].Id}");
|
||||
var foundTmdbId = findResult.PersonResults.First().Id.ToString();
|
||||
this.Log($"GetPersonMetadata of found tmdb [id]: {foundTmdbId}");
|
||||
item.SetProviderId(MetadataProvider.Tmdb, $"{foundTmdbId}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ using System.Net.Http;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Jellyfin.Data.Enums;
|
||||
using System.IO;
|
||||
|
||||
namespace Jellyfin.Plugin.MetaShark.Providers
|
||||
{
|
||||
|
@ -46,13 +48,15 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
info.SeriesProviderIds.TryGetValue(DoubanProviderId, out var sid);
|
||||
var seasonNumber = info.IndexNumber; // S00/Season 00特典目录会为0
|
||||
var seasonSid = info.GetProviderId(DoubanProviderId);
|
||||
var fileName = this.GetOriginalFileName(info);
|
||||
this.Log($"GetSeasonMetaData of [name]: {info.Name} [fileName]: {fileName} number: {info.IndexNumber} seriesTmdbId: {seriesTmdbId} sid: {sid} metaSource: {metaSource} IsAutomated: {info.IsAutomated}");
|
||||
|
||||
var fileName = Path.GetFileName(info.Path);
|
||||
this.Log($"GetSeasonMetaData of [name]: {info.Name} [fileName]: {fileName} number: {info.IndexNumber} seriesTmdbId: {seriesTmdbId} sid: {sid} metaSource: {metaSource} EnableTmdb: {config.EnableTmdb}");
|
||||
if (metaSource != MetaSource.Tmdb && !string.IsNullOrEmpty(sid))
|
||||
{
|
||||
// 季文件夹名称不规范,没法拿到seasonNumber,尝试从文件夹名猜出
|
||||
// 注意:本办法没法处理没有季文件夹的/虚拟季,因为path会为空
|
||||
// seasonNumber 为 null 有三种情况:
|
||||
// 1. 没有季文件夹时,即虚拟季,info.Path 为空
|
||||
// 2. 一般不规范文件夹命名,没法被 EpisodeResolver 解析的,info.Path 不为空,如:摇曳露营△
|
||||
// 3. 特殊不规范文件夹命名,能被 EpisodeResolver 错误解析,这时被当成了视频文件,相当于没有季文件夹,info.Path 为空,如:冰与火之歌 S02.列王的纷争.2012.1080p.Blu-ray.x265.10bit.AC3
|
||||
// 相关代码:https://github.com/jellyfin/jellyfin/blob/dc2eca9f2ca259b46c7b53f59251794903c730a4/Emby.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs#L70
|
||||
if (seasonNumber is null)
|
||||
{
|
||||
seasonNumber = this.GuessSeasonNumberByDirectoryName(info.Path);
|
||||
|
@ -89,19 +93,19 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo
|
||||
{
|
||||
Name = c.Name,
|
||||
Type = c.RoleType,
|
||||
Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor,
|
||||
Role = c.Role,
|
||||
ImageUrl = this.GetLocalProxyImageUrl(c.Img),
|
||||
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } },
|
||||
}));
|
||||
|
||||
this.Log($"GetSeasonMetaData of douban [sid]: {seasonSid}");
|
||||
this.Log($"Season [{info.Name}] found douban [sid]: {seasonSid}");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Log($"GetSeasonMetaData of [name]: {info.Name} not found douban season id!");
|
||||
this.Log($"Season [{info.Name}] not found douban season id!");
|
||||
}
|
||||
|
||||
|
||||
|
@ -139,10 +143,19 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
return null;
|
||||
}
|
||||
|
||||
// 没有季文件夹(即虚拟季),info.Path会为空,直接用series的sid
|
||||
if (string.IsNullOrEmpty(info.Path))
|
||||
// 没有季文件夹或季文件夹名不规范时(即虚拟季),info.Path 会为空,seasonNumber 为 null
|
||||
if (string.IsNullOrEmpty(info.Path) && !seasonNumber.HasValue)
|
||||
{
|
||||
return sid;
|
||||
return null;
|
||||
}
|
||||
|
||||
// 从季文件夹名属性格式获取,如 [douban-12345] 或 [doubanid-12345]
|
||||
var fileName = this.GetOriginalFileName(info);
|
||||
var doubanId = this.regDoubanIdAttribute.FirstMatchGroup(fileName);
|
||||
if (!string.IsNullOrWhiteSpace(doubanId))
|
||||
{
|
||||
this.Log($"Found season douban [id] by attr: {doubanId}");
|
||||
return doubanId;
|
||||
}
|
||||
|
||||
// 从sereis获取正确名称,info.Name当是标准格式如S01等时,会变成第x季,非标准名称默认文件名
|
||||
|
@ -151,7 +164,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
return null;
|
||||
}
|
||||
var seriesName = RemoveSeasonSubfix(series.Name);
|
||||
var seriesName = this.RemoveSeasonSuffix(series.Name);
|
||||
|
||||
// 没有季id,但存在tmdbid,尝试从tmdb获取对应季的年份信息,用于从豆瓣搜索对应季数据
|
||||
var seasonYear = 0;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Jellyfin.Plugin.MetaShark.Api;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.MetaShark.Api;
|
||||
using Jellyfin.Plugin.MetaShark.Model;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
|
@ -104,12 +105,12 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
}
|
||||
subject.Celebrities = await this._doubanApi.GetCelebritiesBySidAsync(sid, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var seriesName = RemoveSeasonSubfix(subject.Name);
|
||||
var seriesName = RemoveSeasonSuffix(subject.Name);
|
||||
var item = new Series
|
||||
{
|
||||
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, subject.Sid }, { Plugin.ProviderId, $"{MetaSource.Douban}_{subject.Sid}" } },
|
||||
Name = seriesName,
|
||||
OriginalTitle = RemoveSeasonSubfix(subject.OriginalName),
|
||||
OriginalTitle = RemoveSeasonSuffix(subject.OriginalName),
|
||||
CommunityRating = subject.Rating,
|
||||
Overview = subject.Intro,
|
||||
ProductionYear = subject.Year,
|
||||
|
@ -152,7 +153,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
subject.LimitDirectorCelebrities.Take(Configuration.PluginConfiguration.MAX_CAST_MEMBERS).ToList().ForEach(c => result.AddPerson(new PersonInfo
|
||||
{
|
||||
Name = c.Name,
|
||||
Type = c.RoleType,
|
||||
Type = c.RoleType == PersonType.Director ? PersonKind.Director : PersonKind.Actor,
|
||||
Role = c.Role,
|
||||
ImageUrl = this.GetLocalProxyImageUrl(c.Img),
|
||||
ProviderIds = new Dictionary<string, string> { { DoubanProviderId, c.Id } },
|
||||
|
@ -356,7 +357,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
Name = actor.Name.Trim(),
|
||||
Role = actor.Character,
|
||||
Type = PersonType.Actor,
|
||||
Type = PersonKind.Actor,
|
||||
SortOrder = actor.Order,
|
||||
};
|
||||
|
||||
|
@ -400,7 +401,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
{
|
||||
Name = person.Name.Trim(),
|
||||
Role = person.Job,
|
||||
Type = type
|
||||
Type = type == PersonType.Director ? PersonKind.Director : (type == PersonType.Producer ? PersonKind.Producer : PersonKind.Actor),
|
||||
};
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(person.ProfilePath))
|
||||
|
|
|
@ -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.Providers;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace Jellyfin.Plugin.MetaShark
|
||||
{
|
||||
|
@ -20,21 +10,22 @@ namespace Jellyfin.Plugin.MetaShark
|
|||
public class ServiceRegistrator : IPluginServiceRegistrator
|
||||
{
|
||||
/// <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>());
|
||||
});
|
||||
serviceCollection.AddSingleton<TmdbApi>((ctx) =>
|
||||
serviceCollection.AddSingleton((ctx) =>
|
||||
{
|
||||
return new TmdbApi(ctx.GetRequiredService<ILoggerFactory>());
|
||||
});
|
||||
serviceCollection.AddSingleton<OmdbApi>((ctx) =>
|
||||
serviceCollection.AddSingleton((ctx) =>
|
||||
{
|
||||
return new OmdbApi(ctx.GetRequiredService<ILoggerFactory>());
|
||||
});
|
||||
serviceCollection.AddSingleton<ImdbApi>((ctx) =>
|
||||
serviceCollection.AddSingleton((ctx) =>
|
||||
{
|
||||
return new ImdbApi(ctx.GetRequiredService<ILoggerFactory>());
|
||||
});
|
||||
|
|
16
README.md
16
README.md
|
@ -1,7 +1,7 @@
|
|||
# jellyfin-plugin-metashark
|
||||
|
||||
[](https://github.com/cxfksword/jellyfin-plugin-metashark/releases)
|
||||
[](https://github.com/cxfksword/jellyfin-plugin-metashark/releases)
|
||||
[](https://github.com/cxfksword/jellyfin-plugin-metashark/releases)
|
||||
[](https://github.com/cxfksword/jellyfin-plugin-metashark/main/LICENSE)
|
||||
|
||||
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
|
||||
|
||||
|
@ -42,7 +40,7 @@ jellyfin电影元数据插件,影片信息只要从豆瓣获取,并由TheMov
|
|||
|
||||
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.
|
||||
|
||||
|
@ -56,7 +54,7 @@ dotnet publish --configuration=Release Jellyfin.Plugin.MetaShark/Jellyfin.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
|
||||
|
||||
|
@ -71,3 +69,9 @@ dotnet publish --configuration=Release Jellyfin.Plugin.MetaShark/Jellyfin.Plugin
|
|||
## Thanks
|
||||
|
||||
[AnitomySharp](https://github.com/chu-shen/AnitomySharp)
|
||||
|
||||
## 免责声明
|
||||
|
||||
本项目代码仅用于学习交流编程技术,下载后请勿用于商业用途。
|
||||
|
||||
如果本项目存在侵犯您的合法权益的情况,请及时与开发者联系,开发者将会及时删除有关内容。
|
|
@ -26,7 +26,7 @@ def generate_version(filepath, version, changelog):
|
|||
return {
|
||||
'version': f"{version}.0",
|
||||
'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',
|
||||
'checksum': md5sum(filepath),
|
||||
'timestamp': datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
|
||||
|
|
Loading…
Reference in New Issue