64 lines
2.6 KiB
Kotlin
64 lines
2.6 KiB
Kotlin
package eu.kanade.data.manga
|
|
|
|
import eu.kanade.domain.chapter.model.Chapter
|
|
import eu.kanade.domain.manga.model.Manga
|
|
|
|
val mangaMapper: (Long, Long, String, String?, String?, String?, List<String>?, String, Long, String?, Boolean, Long?, Long?, Boolean, Long, Long, Long, Long) -> Manga =
|
|
{ id, source, url, artist, author, description, genre, title, status, thumbnailUrl, favorite, lastUpdate, _, initialized, viewer, chapterFlags, coverLastModified, dateAdded ->
|
|
Manga(
|
|
id = id,
|
|
source = source,
|
|
favorite = favorite,
|
|
lastUpdate = lastUpdate ?: 0,
|
|
dateAdded = dateAdded,
|
|
viewerFlags = viewer,
|
|
chapterFlags = chapterFlags,
|
|
coverLastModified = coverLastModified,
|
|
url = url,
|
|
title = title,
|
|
artist = artist,
|
|
author = author,
|
|
description = description,
|
|
genre = genre,
|
|
status = status,
|
|
thumbnailUrl = thumbnailUrl,
|
|
initialized = initialized,
|
|
)
|
|
}
|
|
|
|
val mangaChapterMapper: (Long, Long, String, String?, String?, String?, List<String>?, String, Long, String?, Boolean, Long?, Long?, Boolean, Long, Long, Long, Long, Long, Long, String, String, String?, Boolean, Boolean, Long, Float, Long, Long, Long) -> Pair<Manga, Chapter> =
|
|
{ _id, source, url, artist, author, description, genre, title, status, thumbnailUrl, favorite, lastUpdate, next_update, initialized, viewerFlags, chapterFlags, coverLastModified, dateAdded, chapterId, mangaId, chapterUrl, name, scanlator, read, bookmark, lastPageRead, chapterNumber, sourceOrder, dateFetch, dateUpload ->
|
|
Manga(
|
|
id = _id,
|
|
source = source,
|
|
favorite = favorite,
|
|
lastUpdate = lastUpdate ?: 0,
|
|
dateAdded = dateAdded,
|
|
viewerFlags = viewerFlags,
|
|
chapterFlags = chapterFlags,
|
|
coverLastModified = coverLastModified,
|
|
url = url,
|
|
title = title,
|
|
artist = artist,
|
|
author = author,
|
|
description = description,
|
|
genre = genre,
|
|
status = status,
|
|
thumbnailUrl = thumbnailUrl,
|
|
initialized = initialized,
|
|
) to Chapter(
|
|
id = chapterId,
|
|
mangaId = mangaId,
|
|
read = read,
|
|
bookmark = bookmark,
|
|
lastPageRead = lastPageRead,
|
|
dateFetch = dateFetch,
|
|
sourceOrder = sourceOrder,
|
|
url = chapterUrl,
|
|
name = name,
|
|
dateUpload = dateUpload,
|
|
chapterNumber = chapterNumber,
|
|
scanlator = scanlator,
|
|
)
|
|
}
|