mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Just wrap it with if statement
The last fix somehow reverted the other fix, awesome!
This commit is contained in:
parent
d5651573b0
commit
8f07c2d99a
2 changed files with 19 additions and 33 deletions
|
@ -12,11 +12,6 @@ import eu.kanade.tachiyomi.ui.reader.settings.ReadingModeType
|
||||||
import eu.kanade.tachiyomi.util.manga.MangaCoverMetadata
|
import eu.kanade.tachiyomi.util.manga.MangaCoverMetadata
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import yokai.data.manga.originalArtist
|
|
||||||
import yokai.data.manga.originalAuthor
|
|
||||||
import yokai.data.manga.originalDescription
|
|
||||||
import yokai.data.manga.originalGenre
|
|
||||||
import yokai.data.manga.originalStatus
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
// TODO: Transform into data class
|
// TODO: Transform into data class
|
||||||
|
@ -58,18 +53,26 @@ interface Manga : SManga {
|
||||||
author?.contains(artist ?: "", true) == true
|
author?.contains(artist ?: "", true) == true
|
||||||
|
|
||||||
fun copyFrom(other: SManga) {
|
fun copyFrom(other: SManga) {
|
||||||
author = other.originalAuthor ?: author
|
|
||||||
|
|
||||||
artist = other.originalArtist ?: artist
|
|
||||||
|
|
||||||
description = other.originalDescription ?: description
|
|
||||||
|
|
||||||
genre = other.originalGenre ?: genre
|
|
||||||
|
|
||||||
status = other.originalStatus
|
|
||||||
|
|
||||||
thumbnail_url = other.thumbnail_url ?: thumbnail_url
|
thumbnail_url = other.thumbnail_url ?: thumbnail_url
|
||||||
|
|
||||||
|
if (other.author != null) {
|
||||||
|
author = if (other is Manga) other.originalAuthor else other.author
|
||||||
|
}
|
||||||
|
|
||||||
|
if (other.artist != null) {
|
||||||
|
artist = if (other is Manga) other.originalArtist else other.artist
|
||||||
|
}
|
||||||
|
|
||||||
|
if (other.description != null) {
|
||||||
|
description = if (other is Manga) other.originalDescription else other.description
|
||||||
|
}
|
||||||
|
|
||||||
|
if (other.genre != null) {
|
||||||
|
genre = if (other is Manga) other.originalGenre else other.genre
|
||||||
|
}
|
||||||
|
|
||||||
|
status = if (other is Manga) other.originalStatus else other.status
|
||||||
|
|
||||||
update_strategy = other.update_strategy
|
update_strategy = other.update_strategy
|
||||||
|
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
package yokai.data.manga
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.data.database.models.MangaImpl
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
|
||||||
|
|
||||||
val SManga.originalTitle: String
|
|
||||||
get() = (this as? MangaImpl)?.ogTitle ?: title
|
|
||||||
val SManga.originalAuthor: String?
|
|
||||||
get() = (this as? MangaImpl)?.ogAuthor ?: author
|
|
||||||
val SManga.originalArtist: String?
|
|
||||||
get() = (this as? MangaImpl)?.ogArtist ?: artist
|
|
||||||
val SManga.originalDescription: String?
|
|
||||||
get() = (this as? MangaImpl)?.ogDesc ?: description
|
|
||||||
val SManga.originalGenre: String?
|
|
||||||
get() = (this as? MangaImpl)?.ogGenre ?: genre
|
|
||||||
val SManga.originalStatus: Int
|
|
||||||
get() = (this as? MangaImpl)?.ogStatus ?: status
|
|
Loading…
Add table
Add a link
Reference in a new issue