mirror of
https://github.com/cxfksword/jellyfin-plugin-danmu.git
synced 2026-02-02 17:59:58 +08:00
Optimize match
This commit is contained in:
@@ -279,7 +279,8 @@ public class LibraryManagerEventsHelper : IDisposable
|
||||
if (epId <= 0)
|
||||
{
|
||||
// 搜索查找匹配的视频
|
||||
var seasonId = await GetMatchSeasonId(item, item.Name).ConfigureAwait(false);
|
||||
var searchName = this.GetSearchMovieName(item.Name);
|
||||
var seasonId = await GetMatchSeasonId(item, searchName).ConfigureAwait(false);
|
||||
var season = await _api.GetSeasonAsync(seasonId, CancellationToken.None).ConfigureAwait(false);
|
||||
if (season == null)
|
||||
{
|
||||
@@ -643,6 +644,19 @@ public class LibraryManagerEventsHelper : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
var indexNumber = episode.IndexNumber ?? 0;
|
||||
if (indexNumber <= 0)
|
||||
{
|
||||
_logger.LogInformation("匹配失败,缺少集号. [{0}]{1}}", season.Name, episode.Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (indexNumber > seasonData.Episodes.Length)
|
||||
{
|
||||
_logger.LogInformation("匹配失败,集号过大. [{0}]{1}} indexNumber: {2}", season.Name, episode.Name, indexNumber);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (seasonData.Episodes.Length == episodes.Count)
|
||||
{
|
||||
epId = seasonData.Episodes[idx].Id;
|
||||
@@ -826,6 +840,11 @@ public class LibraryManagerEventsHelper : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSearchMovieName(string movieName)
|
||||
{
|
||||
// 去掉可能存在的季名称
|
||||
return Regex.Replace(movieName, @"\s*第.季", "");
|
||||
}
|
||||
|
||||
private string GetSearchSeasonName(string seriesName, int seasonIndexNumber)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ jellyfin的b站弹幕自动下载插件,会匹配b站番剧和电影视频,
|
||||
|
||||
* 新加入的影片会自动获取弹幕(只匹配番剧和电影视频),旧影片可以通过计划任务**扫描媒体库匹配弹幕**手动执行获取
|
||||
* 可以在元数据中手动指定匹配的视频ID,如播放链接`https://www.bilibili.com/bangumi/play/ep682965`,对应的视频ID就是`682965`
|
||||
* 对于电视剧和动画,可以在元数据中指定季ID,如播放链接`https://www.bilibili.com/bangumi/play/ss1564`,对应的季ID就是`1564`,只要集数和b站的集数的一致,每季视频的弹幕会自动获取
|
||||
* 对于电视剧和动画,可以在元数据中指定季ID,如播放链接`https://www.bilibili.com/bangumi/play/ss1564`,对应的季ID就是`1564`,只要集数和b站的集数的一致,并正确填写了集号,每季视频的弹幕会自动获取
|
||||
* 同时生成ass弹幕,需要在插件配置中打开,默认是关闭的
|
||||
|
||||
> 电影或季元数据也支持手动指定BV号,来匹配UP主上传的视频弹幕。多P视频和剧集是按顺序一一对应匹配的,所以保证jellyfin中剧集有正确的集号很重要
|
||||
@@ -45,7 +45,7 @@ jellyfin的b站弹幕自动下载插件,会匹配b站番剧和电影视频,
|
||||
xml格式:
|
||||
|
||||
* [弹弹play](https://www.dandanplay.com/) (Windows/Mac/Android)
|
||||
* [fileball](https://fileball.app/) (iOS/iPadOS/AppleTV)
|
||||
* [Fileball](https://fileball.app/) (iOS/iPadOS/AppleTV)
|
||||
|
||||
ass格式:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user