mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Fix MangaDex null
This commit is contained in:
@@ -277,9 +277,9 @@ public class MangaDex : MangaConnector
|
|||||||
_ => kv.Key
|
_ => kv.Key
|
||||||
};
|
};
|
||||||
return new Link(key, url);
|
return new Link(key, url);
|
||||||
}).ToList()!;
|
}).ToList()??[];
|
||||||
|
|
||||||
List<AltTitle> altTitles = (altTitlesJArray??[])
|
List<AltTitle> altTitles = altTitlesJArray?
|
||||||
.Select(t =>
|
.Select(t =>
|
||||||
{
|
{
|
||||||
JObject? j = t as JObject;
|
JObject? j = t as JObject;
|
||||||
@@ -287,19 +287,19 @@ public class MangaDex : MangaConnector
|
|||||||
if (p is null)
|
if (p is null)
|
||||||
return null;
|
return null;
|
||||||
return new AltTitle(p.Name, p.Value.ToString());
|
return new AltTitle(p.Name, p.Value.ToString());
|
||||||
}).Where(x => x is not null).ToList()!;
|
}).Where(x => x is not null).Cast<AltTitle>().ToList()??[];
|
||||||
|
|
||||||
List<MangaTag> tags = (tagsJArray??[])
|
List<MangaTag> tags = tagsJArray?
|
||||||
.Where(t => t.Value<string>("type") == "tag")
|
.Where(t => t.Value<string>("type") == "tag")
|
||||||
.Select(t => t["attributes"]?["name"]?.Value<string>("en")??t["attributes"]?["name"]?.First?.First?.Value<string>())
|
.Select(t => t["attributes"]?["name"]?.Value<string>("en")??t["attributes"]?["name"]?.First?.First?.Value<string>())
|
||||||
.Select(str => str is not null ? new MangaTag(str) : null)
|
.Select(str => str is not null ? new MangaTag(str) : null)
|
||||||
.Where(x => x is not null).ToList()!;
|
.Where(x => x is not null).Cast<MangaTag>().ToList()??[];
|
||||||
|
|
||||||
List<Author> authors = relationships
|
List<Author> authors = relationships
|
||||||
.Where(r => r["type"]?.Value<string>() == "author")
|
.Where(r => r["type"]?.Value<string>() == "author")
|
||||||
.Select(t => t["attributes"]?.Value<string>("name"))
|
.Select(t => t["attributes"]?.Value<string>("name"))
|
||||||
.Select(str => str is not null ? new Author(str) : null)
|
.Select(str => str is not null ? new Author(str) : null)
|
||||||
.Where(x => x is not null).ToList()!;
|
.Where(x => x is not null).Cast<Author>().ToList();
|
||||||
|
|
||||||
|
|
||||||
MangaReleaseStatus releaseStatus = status switch
|
MangaReleaseStatus releaseStatus = status switch
|
||||||
|
Reference in New Issue
Block a user