Enhance ChineseNfoRegistry job method to support optional parameters for TMDB ID, season, and episode; update configuration for HTTP proxy and connection string
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Interface.Jobs;
|
||||
using System.Text.Json.Nodes;
|
||||
using Interface.Jobs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace WebApi.Controllers;
|
||||
@@ -22,8 +23,8 @@ public class JobTriggerController : BaseController
|
||||
IDiskActionMonitorRegistry diskActionMonitorRegistry,
|
||||
IHealthyTaskRegistry healthyTaskRegistry,
|
||||
IRSyncTaskRegistry rSyncTaskRegistry,
|
||||
IStartupRegistry startupRegistry,
|
||||
IShutdownRegistry shutdownRegistry,
|
||||
IStartupRegistry startupRegistry,
|
||||
IShutdownRegistry shutdownRegistry,
|
||||
IChineseNfoRegistry chineseNfoRegistry,
|
||||
IDiskMonitorRegistry diskMonitorRegistry)
|
||||
{
|
||||
@@ -77,36 +78,57 @@ public class JobTriggerController : BaseController
|
||||
|
||||
return "OK";
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public string Shutdown()
|
||||
{
|
||||
_shutdownRegistry.Job();
|
||||
|
||||
|
||||
return "OK";
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public string CancelShutdown()
|
||||
{
|
||||
_shutdownRegistry.CancelShutdown();
|
||||
|
||||
|
||||
return "OK";
|
||||
}
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public string ConvertChineseNfo(bool ignoreLocked = false, bool ignoreCompleted = false)
|
||||
public string ConvertChineseNfo(
|
||||
bool ignoreLocked = false,
|
||||
bool ignoreCompleted = false)
|
||||
{
|
||||
_chineseNfoRegistry.Job(ignoreLocked, ignoreCompleted);
|
||||
|
||||
_chineseNfoRegistry.Job(ignoreLocked: ignoreLocked, ignoreCompleted: ignoreCompleted);
|
||||
|
||||
return "OK";
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> SonarrChangedConvertChineseNfo()
|
||||
{
|
||||
var body = Request.Body;
|
||||
|
||||
using var reader = new StreamReader(body);
|
||||
var text = await reader.ReadToEndAsync();
|
||||
|
||||
var json = JsonNode.Parse(text);
|
||||
|
||||
var tmdbId = json?["series"]?["tmdbId"]?.ToString();
|
||||
var seasonNumber = json?["episodes"]?[0]?["seasonNumber"]?.ToString();
|
||||
var episodeNumber = json?["episodes"]?[0]?["episodeNumber"]?.ToString();
|
||||
|
||||
_chineseNfoRegistry.Job(tmdbId: tmdbId, seasonNumber: seasonNumber, episodeNumber: episodeNumber);
|
||||
|
||||
return "OK";
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public string DiskMonitor()
|
||||
{
|
||||
_diskMonitorRegistry.Job();
|
||||
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
],
|
||||
"ChineseNfo": {
|
||||
"TvFolder": "D:\\codes\\others\\ConvertChineseNfo",
|
||||
"HttpProxy": "http://suncheng.online:47890"
|
||||
"HttpProxy": "",
|
||||
"ConnectionString": "Data Source=D:\\codes\\others\\ConvertChineseNfo\\chinesenfo.db;"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user