mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-12 22:47:52 +02:00
Rename Manga.ConnectorId to IdOnConnectorSite
Do not include Manga.CoverUrl and CoverFileNameInCache in API-request-responses
This commit is contained in:
@ -18,12 +18,14 @@ public class Manga
|
||||
[MaxLength(64)]
|
||||
public string MangaId { get; init; }
|
||||
[MaxLength(64)]
|
||||
public string ConnectorId { get; init; }
|
||||
public string IdOnConnectorSite { get; init; }
|
||||
|
||||
public string Name { get; internal set; }
|
||||
public string Description { get; internal set; }
|
||||
public string WebsiteUrl { get; internal set; }
|
||||
[JsonIgnore]
|
||||
public string CoverUrl { get; internal set; }
|
||||
[JsonIgnore]
|
||||
public string? CoverFileNameInCache { get; internal set; }
|
||||
public uint Year { get; internal set; }
|
||||
public string? OriginalLanguage { get; internal set; }
|
||||
@ -47,11 +49,11 @@ public class Manga
|
||||
[JsonIgnore] public ICollection<MangaAltTitle>? AltTitles { get; internal set; }
|
||||
[NotMapped] public IEnumerable<string> AltTitleIds => AltTitles?.Select(a => a.AltTitleId) ?? [];
|
||||
|
||||
public Manga(string connectorId, string name, string description, string websiteUrl, string coverUrl,
|
||||
public Manga(string idOnConnectorSite, string name, string description, string websiteUrl, string coverUrl,
|
||||
string? coverFileNameInCache, uint year, string? originalLanguage, MangaReleaseStatus releaseStatus,
|
||||
float ignoreChapterBefore, MangaConnector mangaConnector, ICollection<Author> authors,
|
||||
ICollection<MangaTag> mangaTags, ICollection<Link> links, ICollection<MangaAltTitle> altTitles)
|
||||
: this(connectorId, name, description, websiteUrl, coverUrl, coverFileNameInCache, year, originalLanguage,
|
||||
: this(idOnConnectorSite, name, description, websiteUrl, coverUrl, coverFileNameInCache, year, originalLanguage,
|
||||
releaseStatus, ignoreChapterBefore, mangaConnector.Name)
|
||||
{
|
||||
this.Authors = authors;
|
||||
@ -60,12 +62,12 @@ public class Manga
|
||||
this.AltTitles = altTitles;
|
||||
}
|
||||
|
||||
public Manga(string connectorId, string name, string description, string websiteUrl, string coverUrl,
|
||||
public Manga(string idOnConnectorSite, string name, string description, string websiteUrl, string coverUrl,
|
||||
string? coverFileNameInCache, uint year, string? originalLanguage, MangaReleaseStatus releaseStatus,
|
||||
float ignoreChapterBefore, string mangaConnectorId)
|
||||
{
|
||||
MangaId = TokenGen.CreateToken(typeof(Manga), mangaConnectorId, connectorId);
|
||||
ConnectorId = connectorId;
|
||||
MangaId = TokenGen.CreateToken(typeof(Manga), mangaConnectorId, idOnConnectorSite);
|
||||
IdOnConnectorSite = idOnConnectorSite;
|
||||
Name = name;
|
||||
Description = description;
|
||||
WebsiteUrl = websiteUrl;
|
||||
|
@ -197,7 +197,7 @@ public class MangaDex : MangaConnector
|
||||
//Request next "Page"
|
||||
RequestResult requestResult =
|
||||
downloadClient.MakeRequest(
|
||||
$"https://api.mangadex.org/manga/{manga.ConnectorId}/feed?limit={limit}&offset={offset}&translatedLanguage%5B%5D={language}&contentRating%5B%5D=safe&contentRating%5B%5D=suggestive&contentRating%5B%5D=erotica&contentRating%5B%5D=pornographic", RequestType.MangaDexFeed);
|
||||
$"https://api.mangadex.org/manga/{manga.IdOnConnectorSite}/feed?limit={limit}&offset={offset}&translatedLanguage%5B%5D={language}&contentRating%5B%5D=safe&contentRating%5B%5D=suggestive&contentRating%5B%5D=erotica&contentRating%5B%5D=pornographic", RequestType.MangaDexFeed);
|
||||
if ((int)requestResult.statusCode < 200 || (int)requestResult.statusCode >= 300)
|
||||
break;
|
||||
JsonObject? result = JsonSerializer.Deserialize<JsonObject>(requestResult.result);
|
||||
|
Reference in New Issue
Block a user