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 {
return BackupManga(
url = manga.url,
title = manga.title,
artist = manga.artist,
author = manga.author,
description = manga.description,
genre = manga.getGenres() ?: emptyList(),
title = manga.originalTitle,
artist = manga.originalArtist,
author = manga.originalAuthor,
description = manga.originalDescription,
genre = manga.getOriginalGenres() ?: emptyList(),
status = manga.status,
thumbnailUrl = manga.thumbnail_url,
favorite = manga.favorite,

View File

@ -69,6 +69,10 @@ interface Manga : SManga {
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)
*/