更新 IChineseNfoRegistry 和 ChineseNfoRegistry 类中的 Job 方法,将 tmdbId 参数更改为 path,并在 JobExecute 方法中增加路径、季号和集号的验证逻辑,改进日志记录以增强错误处理。
This commit is contained in:
@@ -49,7 +49,7 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
||||
}
|
||||
|
||||
public async void Job(
|
||||
string? tmdbId = null,
|
||||
string? path = null,
|
||||
string? seasonNumber = null,
|
||||
string? episodeNumber = null,
|
||||
bool ignoreLocked = false,
|
||||
@@ -58,7 +58,7 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
||||
{
|
||||
try
|
||||
{
|
||||
await JobExecute(tmdbId, seasonNumber, episodeNumber, ignoreLocked, ignoreCompleted);
|
||||
await JobExecute(path, seasonNumber, episodeNumber, ignoreLocked, ignoreCompleted);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -67,9 +67,9 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
||||
}
|
||||
|
||||
private async Task JobExecute(
|
||||
string? tmdbId = null,
|
||||
string? seasonNumber = null,
|
||||
string? episodeNumber = null,
|
||||
string? requestPath = null,
|
||||
string? requestSeasonNumber = null,
|
||||
string? requestEpisodeNumber = null,
|
||||
bool ignoreLocked = false,
|
||||
bool ignoreCompleted = false)
|
||||
{
|
||||
@@ -95,8 +95,19 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach (var tv in tvNfos)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(requestPath))
|
||||
{
|
||||
if (!tv.Contains(requestPath))
|
||||
{
|
||||
_logger.LogInformation("ChineseNfoRegistry.Job() tv is not contains path");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
await HandleTv(tv);
|
||||
@@ -326,6 +337,18 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(requestPath))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(requestSeasonNumber))
|
||||
{
|
||||
if (seasonNumber != int.Parse(requestSeasonNumber))
|
||||
{
|
||||
_logger.LogInformation("ChineseNfoRegistry.Job() seasonNumber is not equal");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var seasonInfo = await GetTmdbSeason(seasonNfo, tmdbId, seasonNumber);
|
||||
|
||||
if (seasonInfo == null)
|
||||
@@ -473,6 +496,21 @@ public class ChineseNfoRegistry : Registry, IChineseNfoRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(requestPath))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(requestSeasonNumber))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(requestEpisodeNumber))
|
||||
{
|
||||
if (seasonNumber != int.Parse(requestSeasonNumber) || episodeNumber != int.Parse(requestEpisodeNumber))
|
||||
{
|
||||
_logger.LogInformation("ChineseNfoRegistry.Job() episodeNumber is not equal");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var episodeInfo = await GetTmdbEpisode(episodeNfo, tmdbId, seasonNumber, episodeNumber);
|
||||
|
||||
if (episodeInfo == null)
|
||||
|
||||
Reference in New Issue
Block a user