mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-13 14:57:53 +02:00
Change return type of api request to get Connectors to get connector-list instead of dictionary
This commit is contained in:
@ -14,7 +14,7 @@ public partial class Server
|
||||
private ValueTuple<HttpStatusCode, object?> GetV2ConnectorConnectorNameGetManga(GroupCollection groups, Dictionary<string, string> requestParameters)
|
||||
{
|
||||
if(groups.Count < 1 ||
|
||||
!_parent.GetConnectors().Keys.Contains(groups[1].Value) ||
|
||||
!_parent.GetConnectors().Any(mangaConnector => mangaConnector.name == groups[1].Value)||
|
||||
!_parent.TryGetConnector(groups[1].Value, out MangaConnector? connector) ||
|
||||
connector is null)
|
||||
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.BadRequest, $"Connector '{groups[1].Value}' does not exist.");
|
||||
|
@ -50,9 +50,9 @@ public partial class Tranga : GlobalBase
|
||||
return connector is not null;
|
||||
}
|
||||
|
||||
public Dictionary<string, string[]> GetConnectors()
|
||||
public List<MangaConnector> GetConnectors()
|
||||
{
|
||||
return _connectors.ToDictionary(c => c.name, c => c.SupportedLanguages);
|
||||
return _connectors.ToList();
|
||||
}
|
||||
|
||||
public Manga? GetPublicationById(string internalId) => GetCachedManga(internalId);
|
||||
|
Reference in New Issue
Block a user