mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-22 23:30:13 +01:00
Change return type of api request to get Connectors to get connector-list instead of dictionary
This commit is contained in:
parent
d80fcd9039
commit
225db8beda
@ -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);
|
||||
|
@ -34,7 +34,7 @@ Returns available Manga Connectors (Scanlation sites)
|
||||
<details>
|
||||
<summary>Returns</summary>
|
||||
|
||||
Dictionary with Connector-Names and supported languages.
|
||||
List of [Connectors](Types.md#Connector)
|
||||
</details>
|
||||
|
||||
### <sub></sub> `/v2/Connector/<ConnectorName>/GetManga`
|
||||
|
@ -1,41 +1,51 @@
|
||||
## Manga
|
||||
```json
|
||||
## Connector
|
||||
|
||||
```
|
||||
{
|
||||
"name": string,
|
||||
"SupportedLanguages": string[]
|
||||
}
|
||||
```
|
||||
|
||||
## Manga
|
||||
```
|
||||
{
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
## Chapter
|
||||
```json
|
||||
```
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
## Job
|
||||
```json
|
||||
```
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
## ProgressToken
|
||||
```json
|
||||
```
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
## Settings
|
||||
```json
|
||||
```
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
## LibraryConnector
|
||||
```json
|
||||
```
|
||||
{
|
||||
}
|
||||
```
|
||||
|
||||
## NotificationConnector
|
||||
```json
|
||||
```
|
||||
{
|
||||
}
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user