diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt index 5cf539d7b..8b6b9900e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.kt @@ -29,11 +29,6 @@ interface Manga : SManga { return chapter_flags and DomainManga.CHAPTER_SORT_DIR_MASK.toInt() == DomainManga.CHAPTER_SORT_DESC.toInt() } - fun getGenres(): List? { - if (genre.isNullOrBlank()) return null - return genre?.split(", ")?.map { it.trim() }?.filterNot { it.isBlank() }?.distinct() - } - private fun setChapterFlags(flag: Int, mask: Int) { chapter_flags = chapter_flags and mask.inv() or (flag and mask) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt index 927faa2ea..8b4477b68 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/model/SManga.kt @@ -24,6 +24,11 @@ interface SManga : Serializable { var initialized: Boolean + fun getGenres(): List? { + if (genre.isNullOrBlank()) return null + return genre?.split(", ")?.map { it.trim() }?.filterNot { it.isBlank() }?.distinct() + } + fun copyFrom(other: SManga) { if (other.author != null) { author = other.author @@ -102,7 +107,7 @@ fun SManga.toMangaInfo(): MangaInfo { artist = this.artist ?: "", author = this.author ?: "", description = this.description ?: "", - genres = this.genre?.split(", ") ?: emptyList(), + genres = this.getGenres() ?: emptyList(), status = this.status, cover = this.thumbnail_url ?: "", )