|
|
@ -1,96 +1,104 @@
|
|
|
|
package com.jeluchu.features.anime.mappers
|
|
|
|
package com.jeluchu.features.anime.mappers
|
|
|
|
|
|
|
|
|
|
|
|
import com.jeluchu.features.themes.models.anime.AnimeThemeEntry
|
|
|
|
|
|
|
|
import com.jeluchu.core.extensions.*
|
|
|
|
import com.jeluchu.core.extensions.*
|
|
|
|
import com.jeluchu.features.anime.models.anime.*
|
|
|
|
import com.jeluchu.features.anime.models.anime.*
|
|
|
|
import com.jeluchu.features.anime.models.directory.AnimeTypeEntity
|
|
|
|
import com.jeluchu.features.anime.models.directory.AnimeTypeEntity
|
|
|
|
import com.jeluchu.features.anime.models.lastepisodes.LastEpisodeData
|
|
|
|
import com.jeluchu.features.anime.models.lastepisodes.LastEpisodeEntity
|
|
|
|
import com.jeluchu.features.rankings.models.AnimeTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.AnimeTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.CharacterTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.CharacterTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.MangaTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.MangaTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.PeopleTopEntity
|
|
|
|
import com.jeluchu.features.rankings.models.PeopleTopEntity
|
|
|
|
import com.jeluchu.features.schedule.models.DayEntity
|
|
|
|
import com.jeluchu.features.schedule.models.DayEntity
|
|
|
|
import com.jeluchu.features.themes.models.anime.Anime
|
|
|
|
import com.jeluchu.features.themes.models.anime.*
|
|
|
|
import com.jeluchu.features.themes.models.anime.AnimeVideoTheme
|
|
|
|
|
|
|
|
import com.jeluchu.features.themes.models.anime.AnimesEntity
|
|
|
|
|
|
|
|
import com.jeluchu.features.themes.models.anime.Video
|
|
|
|
|
|
|
|
import org.bson.Document
|
|
|
|
import org.bson.Document
|
|
|
|
import java.time.ZonedDateTime
|
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToMoreInfoEntity(doc: Document): MoreInfoEntity {
|
|
|
|
fun documentToMoreInfoEntity(doc: Document): MoreInfoEntity {
|
|
|
|
return MoreInfoEntity(
|
|
|
|
return MoreInfoEntity(
|
|
|
|
id = doc.getObjectId("_id").toString(),
|
|
|
|
id = doc.getObjectId("_id").toString(),
|
|
|
|
malId = doc.getIntSafe("malId"),
|
|
|
|
malId = doc.getIntSafe("malId"),
|
|
|
|
|
|
|
|
rank = doc.getIntSafe("rank"),
|
|
|
|
title = doc.getStringSafe("title"),
|
|
|
|
title = doc.getStringSafe("title"),
|
|
|
|
|
|
|
|
episodes = doc.getIntSafe("episodes"),
|
|
|
|
|
|
|
|
episodeList = doc.getListSafe<Document>("episodeList").map { documentToEpisodeInfo(it) },
|
|
|
|
|
|
|
|
type = doc.getStringSafe("type"),
|
|
|
|
|
|
|
|
status = doc.getStringSafe("status"),
|
|
|
|
|
|
|
|
season = doc.getDocumentSafe("season")?.let { documentToSeasonalEntity(it) },
|
|
|
|
poster = doc.getStringSafe("poster"),
|
|
|
|
poster = doc.getStringSafe("poster"),
|
|
|
|
cover = doc.getStringSafe("cover"),
|
|
|
|
cover = doc.getStringSafe("cover"),
|
|
|
|
genres = doc.getListSafe<String>("genres"),
|
|
|
|
duration = doc.getDocumentSafe("duration")?.let { documentToEpisodeDurationEntity(it) },
|
|
|
|
synopsis = doc.getStringSafe("synopsis"),
|
|
|
|
|
|
|
|
episodes = doc.getListSafe<Document>("episodes").map { documentToMergedEpisode(it) },
|
|
|
|
|
|
|
|
episodesCount = doc.getIntSafe("episodesCount", 0),
|
|
|
|
|
|
|
|
score = doc.getStringSafe("score"),
|
|
|
|
score = doc.getStringSafe("score"),
|
|
|
|
staff = doc.getListSafe<Document>("staff").map { documentToStaff(it) },
|
|
|
|
titles = doc.getDocumentSafe("titles")?.let { documentToOtherTitlesEntity(it) },
|
|
|
|
characters = doc.getListSafe<Document>("characters").map { documentToCharacter(it) },
|
|
|
|
|
|
|
|
status = doc.getStringSafe("status"),
|
|
|
|
|
|
|
|
type = doc.getStringSafe("type"),
|
|
|
|
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
|
|
|
|
promo = doc.getDocumentSafe("promo")?.let { documentToVideoPromo(it) },
|
|
|
|
|
|
|
|
duration = doc.getStringSafe("duration"),
|
|
|
|
|
|
|
|
rank = doc.getIntSafe("rank", 0),
|
|
|
|
|
|
|
|
titles = doc.getListSafe<Document>("titles").map { documentToAlternativeTitles(it) },
|
|
|
|
|
|
|
|
airing = doc.getBooleanSafe("airing"),
|
|
|
|
|
|
|
|
aired = doc.getDocumentSafe("aired")?.let { documentToAiringTime(it) } ?: AiringTime(),
|
|
|
|
|
|
|
|
broadcast = doc.getDocumentSafe("broadcast")?.let { documentToAnimeBroadcast(it) } ?: AnimeBroadcast(),
|
|
|
|
|
|
|
|
season = doc.getStringSafe("season"),
|
|
|
|
|
|
|
|
year = doc.getIntSafe("year", 0),
|
|
|
|
|
|
|
|
external = doc.getListSafe<Document>("external").map { documentToExternalLinks(it) },
|
|
|
|
|
|
|
|
streaming = doc.getListSafe<Document>("streaming").map { documentToExternalLinks(it) },
|
|
|
|
|
|
|
|
studios = doc.getListSafe<Document>("studios").map { documentToCompanies(it) },
|
|
|
|
studios = doc.getListSafe<Document>("studios").map { documentToCompanies(it) },
|
|
|
|
licensors = doc.getListSafe<Document>("licensors").map { documentToCompanies(it) },
|
|
|
|
|
|
|
|
producers = doc.getListSafe<Document>("producers").map { documentToCompanies(it) },
|
|
|
|
producers = doc.getListSafe<Document>("producers").map { documentToCompanies(it) },
|
|
|
|
theme = doc.getDocumentSafe("theme")?.let { documentToThemes(it) } ?: Themes(),
|
|
|
|
licensors = doc.getListSafe<Document>("licensors").map { documentToCompanies(it) },
|
|
|
|
relations = doc.getListSafe<Document>("relations").map { documentToRelated(it) },
|
|
|
|
relations = doc.getListSafe<Document>("relations").map { documentToRelated(it) },
|
|
|
|
stats = doc.getDocumentSafe("stats")?.let { documentToStatistics(it) } ?: Statistics(),
|
|
|
|
promo = doc.getDocumentSafe("promo")?.let { documentToVideoPromo(it) },
|
|
|
|
gallery = doc.getListSafe<Document>("gallery").map { documentToImageMediaEntity(it) },
|
|
|
|
tags = doc.getDocumentSafe("genres")?.let { documentToMultipleLanguageLists(it) },
|
|
|
|
episodeSource = doc.getStringSafe("episodeSource")
|
|
|
|
synopsis = doc.getDocumentSafe("synopsis")?.let { documentToMultipleLanguage(it) },
|
|
|
|
|
|
|
|
staff = doc.getListSafe<Document>("staff").map { documentToStaff(it) },
|
|
|
|
|
|
|
|
characters = doc.getListSafe<Document>("characters").map { documentToCharacter(it) },
|
|
|
|
|
|
|
|
streaming = doc.getListSafe<Document>("streaming").map { documentToExternalLinks(it) },
|
|
|
|
|
|
|
|
urls = doc.getListSafe<String>("urls").takeIf { it.isNotEmpty() } ?: listOf(doc.getStringSafe("url")).filter { it.isNotEmpty() },
|
|
|
|
|
|
|
|
broadcast = doc.getDocumentSafe("broadcast")?.let { documentToAnimeBroadcast(it) },
|
|
|
|
|
|
|
|
external = doc.getListSafe<Document>("external").map { documentToExternalLinks(it) },
|
|
|
|
|
|
|
|
stats = doc.getDocumentSafe("stats")?.let { documentToStatistics(it) },
|
|
|
|
|
|
|
|
nsfw = doc.getBooleanSafe("nsfw", false),
|
|
|
|
|
|
|
|
ageRating = doc.getStringSafe("ageRating"),
|
|
|
|
|
|
|
|
aired = doc.getDocumentSafe("aired")?.let { documentToAiringTime(it) },
|
|
|
|
|
|
|
|
themes = doc.getDocumentSafe("theme")?.let { documentToThemes(it) }
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToActor(doc: Document): Actor {
|
|
|
|
fun documentToEpisodeInfo(doc: Document): EpisodeInfo {
|
|
|
|
return Actor(
|
|
|
|
return EpisodeInfo(
|
|
|
|
person = doc.getDocumentSafe("person")?.let { documentToIndividual(it) } ?: Individual(),
|
|
|
|
number = doc.getIntSafe("number"),
|
|
|
|
language = doc.getStringSafe("language")
|
|
|
|
seasonNumber = doc.getIntSafe("season_number"),
|
|
|
|
|
|
|
|
relativeNumber = doc.getIntSafe("relative_number"),
|
|
|
|
|
|
|
|
airdate = doc.getStringSafe("airdate"),
|
|
|
|
|
|
|
|
duration = doc.getIntSafe("duration"),
|
|
|
|
|
|
|
|
thumbnail = doc.getStringSafe("thumbnail"),
|
|
|
|
|
|
|
|
synopsis = doc.getDocumentSafe("synopsis")?.let { documentToMultipleLanguage(it) },
|
|
|
|
|
|
|
|
titles = doc.getDocumentSafe("titles")?.let { documentToMultipleLanguageTitles(it) },
|
|
|
|
|
|
|
|
score = doc.getDoubleSafe("score"),
|
|
|
|
|
|
|
|
filler = doc.getBooleanSafe("filler", false),
|
|
|
|
|
|
|
|
recap = doc.getBooleanSafe("recap", false)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAiringTime(doc: Document): AiringTime {
|
|
|
|
fun documentToMultipleLanguage(doc: Document): MultipleLanguage {
|
|
|
|
return AiringTime(
|
|
|
|
return MultipleLanguage(
|
|
|
|
from = doc.getStringSafe("from"),
|
|
|
|
es = doc.getStringSafe("es"),
|
|
|
|
to = doc.getStringSafe("to")
|
|
|
|
en = doc.getStringSafe("en")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAlternativeTitles(doc: Document): AlternativeTitles {
|
|
|
|
fun documentToMultipleLanguageTitles(doc: Document): MultipleLanguageTitles {
|
|
|
|
return AlternativeTitles(
|
|
|
|
return MultipleLanguageTitles(
|
|
|
|
title = doc.getStringSafe("title"),
|
|
|
|
es = doc.getStringSafe("es"),
|
|
|
|
type = doc.getStringSafe("type")
|
|
|
|
en = doc.getStringSafe("en"),
|
|
|
|
|
|
|
|
jp = doc.getStringSafe("jp"),
|
|
|
|
|
|
|
|
romaji_jp = doc.getStringSafe("romaji_jp")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAnimeBroadcast(doc: Document): AnimeBroadcast {
|
|
|
|
fun documentToSeasonalEntity(doc: Document): SeasonalEntity {
|
|
|
|
return AnimeBroadcast(
|
|
|
|
return SeasonalEntity(
|
|
|
|
day = doc.getStringSafe("day"),
|
|
|
|
station = doc.getStringSafe("station"),
|
|
|
|
time = doc.getStringSafe("time"),
|
|
|
|
year = doc.getIntSafe("year")
|
|
|
|
timezone = doc.getStringSafe("timezone")
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToCharacter(doc: Document): Character {
|
|
|
|
fun documentToEpisodeDurationEntity(doc: Document): EpisodeDurationEntity {
|
|
|
|
return Character(
|
|
|
|
return EpisodeDurationEntity(
|
|
|
|
character = doc.getDocumentSafe("character")?.let { documentToIndividual(it) } ?: Individual(),
|
|
|
|
unit = doc.getStringSafe("unit"),
|
|
|
|
role = doc.getStringSafe("role"),
|
|
|
|
value = doc.getIntSafe("value")
|
|
|
|
voiceActor = doc.getListSafe<Document>("voiceActor").map { documentToActor(it) }
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToOtherTitlesEntity(doc: Document): OtherTitlesEntity {
|
|
|
|
|
|
|
|
return OtherTitlesEntity(
|
|
|
|
|
|
|
|
synonyms = doc.getListSafe<String>("synonyms"),
|
|
|
|
|
|
|
|
abbreviatedTitles = doc.getListSafe<String>("abbreviated_titles")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -103,20 +111,19 @@ fun documentToCompanies(doc: Document): Companies {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToExternalLinks(doc: Document): ExternalLinks {
|
|
|
|
fun documentToRelated(doc: Document): Related {
|
|
|
|
return ExternalLinks(
|
|
|
|
return Related(
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
entry = doc.getListSafe<Document>("entry").map { documentToCompanies(it) },
|
|
|
|
name = doc.getStringSafe("name")
|
|
|
|
relation = doc.getStringSafe("relation")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToImageMediaEntity(doc: Document): ImageMediaEntity {
|
|
|
|
fun documentToVideoPromo(doc: Document): VideoPromo {
|
|
|
|
return ImageMediaEntity(
|
|
|
|
return VideoPromo(
|
|
|
|
media = doc.getStringSafe("media"),
|
|
|
|
embedUrl = doc.getStringSafe("embedUrl"),
|
|
|
|
thumbnail = doc.getStringSafe("thumbnail"),
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
width = doc.getIntSafe("width", 0),
|
|
|
|
youtubeId = doc.getStringSafe("youtubeId"),
|
|
|
|
height = doc.getIntSafe("height", 0),
|
|
|
|
images = doc.getDocumentSafe("images")?.let { documentToImages(it) } ?: Images()
|
|
|
|
url = doc.getStringSafe("url")
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -130,51 +137,51 @@ fun documentToImages(doc: Document): Images {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToIndividual(doc: Document): Individual {
|
|
|
|
fun documentToMultipleLanguageLists(doc: Document): MultipleLanguageLists {
|
|
|
|
return Individual(
|
|
|
|
return MultipleLanguageLists(
|
|
|
|
malId = doc.getIntSafe("malId", 0),
|
|
|
|
es = doc.getListSafe<String>("es"),
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
en = doc.getListSafe<String>("en")
|
|
|
|
name = doc.getStringSafe("name"),
|
|
|
|
|
|
|
|
images = doc.getStringSafe("images")
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToMergedEpisode(doc: Document): MergedEpisode {
|
|
|
|
fun documentToStaff(doc: Document): Staff {
|
|
|
|
return MergedEpisode(
|
|
|
|
return Staff(
|
|
|
|
malId = doc.getIntSafe("malId"),
|
|
|
|
person = doc.getDocumentSafe("person")?.let { documentToIndividual(it) } ?: Individual(),
|
|
|
|
title = doc.getStringSafe("title"),
|
|
|
|
positions = doc.getListSafe<String>("positions")
|
|
|
|
titleJapanese = doc.getStringSafe("titleJapanese"),
|
|
|
|
|
|
|
|
titleRomanji = doc.getStringSafe("titleRomanji"),
|
|
|
|
|
|
|
|
aired = doc.getStringSafe("aired", ZonedDateTime.now().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)),
|
|
|
|
|
|
|
|
score = doc.getFloatSafe("score"),
|
|
|
|
|
|
|
|
filler = doc.getBooleanSafe("filler"),
|
|
|
|
|
|
|
|
recap = doc.getBooleanSafe("recap")
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToRelated(doc: Document): Related {
|
|
|
|
fun documentToCharacter(doc: Document): Character {
|
|
|
|
return Related(
|
|
|
|
return Character(
|
|
|
|
entry = doc.getListSafe<Document>("entry").map { documentToCompanies(it) },
|
|
|
|
malId = doc.getIntSafe("mal_id", 0),
|
|
|
|
relation = doc.getStringSafe("relation")
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
|
|
|
|
name = doc.getStringSafe("name"),
|
|
|
|
|
|
|
|
images = doc.getStringSafe("images"),
|
|
|
|
|
|
|
|
role = doc.getStringSafe("role"),
|
|
|
|
|
|
|
|
voiceActor = doc.getListSafe<Document>("voice_actor").map { documentToActor(it) }
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToScore(doc: Document): Score {
|
|
|
|
fun documentToActor(doc: Document): Actor {
|
|
|
|
return Score(
|
|
|
|
return Actor(
|
|
|
|
percentage = when (val value = doc["percentage"]) {
|
|
|
|
person = doc.getDocumentSafe("person")?.let { documentToIndividual(it) } ?: Individual(),
|
|
|
|
is Double -> value
|
|
|
|
language = doc.getStringSafe("language")
|
|
|
|
is Int -> value.toDouble()
|
|
|
|
|
|
|
|
else -> 0.0
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
score = doc.getIntSafe("score", 0),
|
|
|
|
|
|
|
|
votes = doc.getIntSafe("votes", 0)
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToStaff(doc: Document): Staff {
|
|
|
|
fun documentToIndividual(doc: Document): Individual {
|
|
|
|
return Staff(
|
|
|
|
return Individual(
|
|
|
|
person = doc.get("person", Document::class.java)?.let { documentToIndividual(it) } ?: Individual(),
|
|
|
|
malId = doc.getIntSafe("malId", 0),
|
|
|
|
positions = doc.getListSafe<String>("positions")
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
|
|
|
|
name = doc.getStringSafe("name"),
|
|
|
|
|
|
|
|
images = doc.getStringSafe("images")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToExternalLinks(doc: Document): ExternalLinks {
|
|
|
|
|
|
|
|
return ExternalLinks(
|
|
|
|
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
|
|
|
|
name = doc.getStringSafe("name")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -190,19 +197,37 @@ fun documentToStatistics(doc: Document): Statistics {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAiringTime(doc: Document): AiringTime {
|
|
|
|
|
|
|
|
return AiringTime(
|
|
|
|
|
|
|
|
from = doc.getStringSafe("from"),
|
|
|
|
|
|
|
|
to = doc.getStringSafe("to")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToThemes(doc: Document): Themes {
|
|
|
|
fun documentToThemes(doc: Document): Themes {
|
|
|
|
return Themes(
|
|
|
|
return Themes(
|
|
|
|
endings = doc.getListSafe<String>("endings"),
|
|
|
|
openings = doc.getListSafe<String>("openings"),
|
|
|
|
openings = doc.getListSafe<String>("openings")
|
|
|
|
endings = doc.getListSafe<String>("endings")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToVideoPromo(doc: Document): VideoPromo {
|
|
|
|
fun documentToAnimeBroadcast(doc: Document): AnimeBroadcast {
|
|
|
|
return VideoPromo(
|
|
|
|
return AnimeBroadcast(
|
|
|
|
embedUrl = doc.getStringSafe("embedUrl"),
|
|
|
|
day = doc.getStringSafe("day"),
|
|
|
|
url = doc.getStringSafe("url"),
|
|
|
|
time = doc.getStringSafe("time"),
|
|
|
|
youtubeId = doc.getStringSafe("youtubeId"),
|
|
|
|
timezone = doc.getStringSafe("timezone")
|
|
|
|
images = doc.get("images", Document::class.java)?.let { documentToImages(it) } ?: Images()
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToScore(doc: Document): Score {
|
|
|
|
|
|
|
|
return Score(
|
|
|
|
|
|
|
|
percentage = when (val value = doc["percentage"]) {
|
|
|
|
|
|
|
|
is Double -> value
|
|
|
|
|
|
|
|
is Int -> value.toDouble()
|
|
|
|
|
|
|
|
else -> 0.0
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
score = doc.getIntSafe("score", 0),
|
|
|
|
|
|
|
|
votes = doc.getIntSafe("votes", 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -228,7 +253,7 @@ fun documentToAnimeTopEntity(doc: Document) = AnimeTopEntity(
|
|
|
|
subtype = doc.getStringSafe("subtype"),
|
|
|
|
subtype = doc.getStringSafe("subtype"),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAnimeLastEpisodeEntity(doc: Document) = LastEpisodeData(
|
|
|
|
fun documentToAnimeLastEpisodeEntity(doc: Document) = LastEpisodeEntity(
|
|
|
|
malId = doc.getIntSafe("malId"),
|
|
|
|
malId = doc.getIntSafe("malId"),
|
|
|
|
title = doc.getStringSafe("title"),
|
|
|
|
title = doc.getStringSafe("title"),
|
|
|
|
image = doc.getStringSafe("image"),
|
|
|
|
image = doc.getStringSafe("image"),
|
|
|
@ -290,15 +315,6 @@ fun documentToAnimeDirectoryEntity(doc: Document) = AnimeTypeEntity(
|
|
|
|
season = doc.getStringSafe("season")
|
|
|
|
season = doc.getStringSafe("season")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAnimesEntity(doc: Document) = AnimesEntity(
|
|
|
|
|
|
|
|
year = doc.getIntSafe("year"),
|
|
|
|
|
|
|
|
slug = doc.getStringSafe("slug"),
|
|
|
|
|
|
|
|
name = doc.getStringSafe("name"),
|
|
|
|
|
|
|
|
image = doc.getStringSafe("image"),
|
|
|
|
|
|
|
|
season = doc.getStringSafe("season")
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun documentToAnimesThemeEntity(doc: Document) = Anime(
|
|
|
|
fun documentToAnimesThemeEntity(doc: Document) = Anime(
|
|
|
|
year = doc.getIntSafe("year"),
|
|
|
|
year = doc.getIntSafe("year"),
|
|
|
|
slug = doc.getStringSafe("slug"),
|
|
|
|
slug = doc.getStringSafe("slug"),
|
|
|
|