mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-07 11:21:35 +02:00
Add Endpoint POST /v2/Manga/internalId/ignoreChaptersBelow #167
This commit is contained in:
@ -76,4 +76,20 @@ public partial class Server
|
||||
};
|
||||
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.OK, latest);
|
||||
}
|
||||
|
||||
private ValueTuple<HttpStatusCode, object?> PostV2MangaInternalIdIgnoreChaptersBelow(GroupCollection groups, Dictionary<string, string> requestParameters)
|
||||
{
|
||||
if(groups.Count < 1 ||
|
||||
!_parent.TryGetPublicationById(groups[1].Value, out Manga? manga) ||
|
||||
manga is null)
|
||||
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.NotFound, $"Manga with ID '{groups[1].Value} could not be found.'");
|
||||
if (requestParameters.TryGetValue("startChapter", out string? startChapterStr) &&
|
||||
float.TryParse(startChapterStr, out float startChapter))
|
||||
{
|
||||
Manga manga1 = manga.Value;
|
||||
manga1.ignoreChaptersBelow = startChapter;
|
||||
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.OK, null);
|
||||
}else
|
||||
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.InternalServerError, "Parameter 'startChapter' missing, or failed to parse.");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user