Skip to content

Commit

Permalink
Fix ignore change season name
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfksword committed Feb 20, 2023
1 parent a1b5e7c commit 65e1f95
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Jellyfin.Plugin.Danmu/LibraryManagerEventsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,17 +484,21 @@ public async Task ProcessQueuedSeasonEvents(IReadOnlyCollection<LibraryEvent> ev
{
try
{
// 读取最新数据,要不然取不到年份信息
var currentItem = _libraryManager.GetItemById(season.Id) ?? season;
// 读取最新数据,要不然取不到年份信息(不能对GetItemById的对象直接修改属性,要不然会直接改到数据!!!!)
var currentItem = _libraryManager.GetItemById(season.Id);
if (currentItem != null)
{
season.ProductionYear = currentItem.ProductionYear;
}
// 季的名称不准确,改使用series的名称
if (series != null)
{
currentItem.Name = series.Name;
season.Name = series.Name;
}
var mediaId = await scraper.SearchMediaId(currentItem);
var mediaId = await scraper.SearchMediaId(season);
if (string.IsNullOrEmpty(mediaId))
{
_logger.LogInformation("[{0}]匹配失败:{1} ({2})", scraper.Name, currentItem.Name, currentItem.ProductionYear);
_logger.LogInformation("[{0}]匹配失败:{1} ({2})", scraper.Name, season.Name, season.ProductionYear);
continue;
}

Expand Down Expand Up @@ -599,7 +603,7 @@ public async Task ProcessQueuedSeasonEvents(IReadOnlyCollection<LibraryEvent> ev
}
else
{
_logger.LogInformation("[{0}]刷新弹幕失败, 集数不一致。video: {1} 弹幕数:{2} 集数:{3}", scraper.Name, season.Name, media.Episodes.Count, episodes.Count);
_logger.LogInformation("[{0}]刷新弹幕失败, 集数不一致。video: {1}.{2} 弹幕数:{3} 集数:{4}", scraper.Name, indexNumber, episode.Name, media.Episodes.Count, episodes.Count);
}
}

Expand Down

0 comments on commit 65e1f95

Please sign in to comment.