@@ -14,22 +14,6 @@ import org.bson.Document
1414import java.time.ZonedDateTime
1515import java.time.format.DateTimeFormatter
1616
17- fun documentToAnimeDirectoryEntity (doc : Document ) = AnimeDirectoryEntity (
18- rank = doc.getIntSafe(" rank" ),
19- year = doc.getIntSafe(" year" ),
20- url = doc.getStringSafe(" url" ),
21- malId = doc.getIntSafe(" malId" ),
22- type = doc.getStringSafe(" type" ),
23- score = doc.getStringSafe(" score" ),
24- title = doc.getStringSafe(" title" ),
25- status = doc.getStringSafe(" status" ),
26- season = doc.getStringSafe(" season" ),
27- poster = doc.getStringSafe(" poster" ),
28- airing = doc.getBooleanSafe(" airing" ),
29- genres = doc.getListSafe<String >(" genres" ),
30- episodesCount = doc.getIntSafe(" episodesCount" )
31- )
32-
3317fun documentToMoreInfoEntity (doc : Document ): MoreInfoEntity {
3418 return MoreInfoEntity (
3519 id = doc.getObjectId(" _id" ).toString(),
@@ -295,6 +279,17 @@ fun documentToAnimeTypeEntity(doc: Document) = AnimeTypeEntity(
295279 episodes = doc.getListSafe<Document >(" episodes" ).size
296280)
297281
282+ fun documentToAnimeDirectoryEntity (doc : Document ) = AnimeTypeEntity (
283+ score = doc.getString(" score" ),
284+ malId = doc.getIntSafe(" malId" ),
285+ year = doc.getIntSafe(" year" ),
286+ season = doc.getStringSafe(" season" ),
287+ type = doc.getStringSafe(" type" ),
288+ title = doc.getStringSafe(" title" ),
289+ image = doc.getStringSafe(" image" ),
290+ episodes = doc.getListSafe<Document >(" episodes" ).size
291+ )
292+
298293fun documentToLastEpisodesEntity (doc : Document ) = EpisodeEntity (
299294 number = doc.getIntSafe(" number" ),
300295 title = doc.getStringSafe(" title" ),
0 commit comments