feat: fall back to file-based matching for movies

This commit is contained in:
Moeta Yuko
2025-03-04 11:31:39 +08:00
parent 751b02933b
commit b5b7fa17bb

View File

@@ -279,11 +279,17 @@ public class LibraryManagerEventsHelper : IDisposable
// 读取最新数据,要不然取不到年份信息
var currentItem = _libraryManager.GetItemById(item.Id) ?? item;
var mediaId = await scraper.SearchMediaId(currentItem);
var mediaId = await scraper.SearchMediaId(currentItem).ConfigureAwait(false);
if (string.IsNullOrEmpty(mediaId))
{
_logger.LogInformation("[{0}]匹配失败:{1} ({2})", scraper.Name, item.Name, item.ProductionYear);
continue;
_logger.LogInformation("[{0}]元数据匹配失败:{1} ({2}),尝试文件匹配", scraper.Name, item.Name, item.ProductionYear);
mediaId = await scraper.SearchMediaIdByFile((Movie)currentItem).ConfigureAwait(false);
if (string.IsNullOrEmpty(mediaId))
{
_logger.LogInformation("[{0}]文件匹配失败:{1}", scraper.Name, currentItem.Path);
continue;
}
}
var media = await scraper.GetMedia(item, mediaId);