mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-04 01:44:17 +02:00
Refactor Controllers
SettingsController.cs SearchController.cs QueryController.cs NotificationConnectorController.cs MetadataFetcherController.cs MangaConnectorController.cs FileLibraryController LibraryConnectors WorkerController
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record GotifyRecord(string endpoint, string appToken, int priority)
|
||||
public record GotifyRecord(string Name, string Endpoint, string AppToken, int Priority)
|
||||
{
|
||||
public bool Validate()
|
||||
{
|
||||
if (endpoint == string.Empty)
|
||||
if (Endpoint == string.Empty)
|
||||
return false;
|
||||
if (appToken == string.Empty)
|
||||
if (AppToken == string.Empty)
|
||||
return false;
|
||||
if (priority < 0 || priority > 10)
|
||||
if (Priority < 0 || Priority > 10)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -1,3 +0,0 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record ModifyJobRecord(ulong? RecurrenceMs, bool? Enabled);
|
3
API/APIEndpointRecords/ModifyWorkerRecord.cs
Normal file
3
API/APIEndpointRecords/ModifyWorkerRecord.cs
Normal file
@ -0,0 +1,3 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record ModifyWorkerRecord(ulong? IntervalMs);
|
@ -1,13 +0,0 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record NewLibraryRecord(string path, string name)
|
||||
{
|
||||
public bool Validate()
|
||||
{
|
||||
if (path.Length < 1) //TODO Better Path validation
|
||||
return false;
|
||||
if (name.Length < 1)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,16 +1,16 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record NtfyRecord(string endpoint, string username, string password, string topic, int priority)
|
||||
public record NtfyRecord(string Name, string Endpoint, string Username, string Password, string Topic, int Priority)
|
||||
{
|
||||
public bool Validate()
|
||||
{
|
||||
if (endpoint == string.Empty)
|
||||
if (Endpoint == string.Empty)
|
||||
return false;
|
||||
if (username == string.Empty)
|
||||
if (Username == string.Empty)
|
||||
return false;
|
||||
if (password == string.Empty)
|
||||
if (Password == string.Empty)
|
||||
return false;
|
||||
if (priority < 1 || priority > 5)
|
||||
if (Priority < 1 || Priority > 5)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
namespace API.APIEndpointRecords;
|
||||
|
||||
public record PushoverRecord(string apptoken, string user)
|
||||
public record PushoverRecord(string Name, string AppToken, string User)
|
||||
{
|
||||
public bool Validate()
|
||||
{
|
||||
if (apptoken == string.Empty)
|
||||
if (AppToken == string.Empty)
|
||||
return false;
|
||||
if (user == string.Empty)
|
||||
if (User == string.Empty)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user