Backing up original title/metadata for manga instead of custom data

This commit is contained in:
Jays2Kings 2021-03-26 00:18:04 -04:00
parent 003c6ed255
commit f65460be05
2 changed files with 9 additions and 5 deletions

View File

@ -69,11 +69,11 @@ data class BackupManga(
fun copyFrom(manga: Manga): BackupManga { fun copyFrom(manga: Manga): BackupManga {
return BackupManga( return BackupManga(
url = manga.url, url = manga.url,
title = manga.title, title = manga.originalTitle,
artist = manga.artist, artist = manga.originalArtist,
author = manga.author, author = manga.originalAuthor,
description = manga.description, description = manga.originalDescription,
genre = manga.getGenres() ?: emptyList(), genre = manga.getOriginalGenres() ?: emptyList(),
status = manga.status, status = manga.status,
thumbnailUrl = manga.thumbnail_url, thumbnailUrl = manga.thumbnail_url,
favorite = manga.favorite, favorite = manga.favorite,

View File

@ -69,6 +69,10 @@ interface Manga : SManga {
return genre?.split(", ")?.map { it.trim() } return genre?.split(", ")?.map { it.trim() }
} }
fun getOriginalGenres(): List<String>? {
return (originalGenre ?: genre)?.split(", ")?.map { it.trim() }
}
/** /**
* The type of comic the manga is (ie. manga, manhwa, manhua) * The type of comic the manga is (ie. manga, manhwa, manhua)
*/ */