Add Controller

This commit is contained in:
2025-09-21 16:59:12 +02:00
parent 4e3968f4b1
commit 55a8b09310
8 changed files with 76 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using API.MangaDownloadClients;
using API.Controllers.Requests;
using API.MangaDownloadClients;
using Asp.Versioning;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
@@ -290,4 +291,19 @@ public class SettingsController() : Controller
Tranga.Settings.SetDownloadLanguage(Language);
return TypedResults.Ok();
}
/// <summary>
/// Sets the time when Libraries are refreshed
/// </summary>
/// <response code="200"></response>
[HttpPatch("LibraryRefresh")]
[ProducesResponseType(Status200OK)]
public Ok SetLibraryRefresh([FromBody]PatchLibraryRefreshRecord requestData)
{
Tranga.Settings.SetLibraryRefreshSetting(requestData.Setting);
if(requestData.RefreshLibraryWhileDownloadingEveryMinutes is { } value)
Tranga.Settings.SetRefreshLibraryWhileDownloadingEveryMinutes(value);
return TypedResults.Ok();
}
}