@@ -14,22 +14,6 @@ import org.bson.Document
14
14
import java.time.ZonedDateTime
15
15
import java.time.format.DateTimeFormatter
16
16
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
-
33
17
fun documentToMoreInfoEntity (doc : Document ): MoreInfoEntity {
34
18
return MoreInfoEntity (
35
19
id = doc.getObjectId(" _id" ).toString(),
@@ -295,6 +279,17 @@ fun documentToAnimeTypeEntity(doc: Document) = AnimeTypeEntity(
295
279
episodes = doc.getListSafe<Document >(" episodes" ).size
296
280
)
297
281
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
+
298
293
fun documentToLastEpisodesEntity (doc : Document ) = EpisodeEntity (
299
294
number = doc.getIntSafe(" number" ),
300
295
title = doc.getStringSafe(" title" ),
0 commit comments