mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-09 11:19:25 +01:00
Fixed blank title when refreshing metadata
This commit is contained in:
parent
2c33040a5f
commit
94b82ee40e
@ -1,7 +1,6 @@
|
||||
package eu.kanade.tachiyomi.data.database.models
|
||||
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import java.lang.Exception
|
||||
|
||||
open class MangaImpl : Manga {
|
||||
|
||||
@ -38,16 +37,14 @@ open class MangaImpl : Manga {
|
||||
override var hide_title: Boolean = false
|
||||
|
||||
override fun copyFrom(other: SManga) {
|
||||
try {
|
||||
if (other.title != title) {
|
||||
title = if (currentTitle() != originalTitle()) {
|
||||
val customTitle = currentTitle()
|
||||
val trueTitle = other.title
|
||||
"${customTitle}${SManga.splitter}${trueTitle}"
|
||||
} else other.title
|
||||
}
|
||||
if (other is MangaImpl && (other as MangaImpl)::title.isInitialized && !other.title
|
||||
.isBlank()) {
|
||||
title = if (currentTitle() != originalTitle()) {
|
||||
val customTitle = currentTitle()
|
||||
val trueTitle = other.title
|
||||
"${customTitle}${SManga.splitter}${trueTitle}"
|
||||
} else other.title
|
||||
}
|
||||
catch(e: Exception) { }
|
||||
super.copyFrom(other)
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.model
|
||||
|
||||
import eu.kanade.tachiyomi.data.database.models.MangaImpl
|
||||
import java.io.Serializable
|
||||
|
||||
interface SManga : Serializable {
|
||||
@ -100,7 +101,7 @@ interface SManga : Serializable {
|
||||
const val splitter = "▒ ▒∩▒"
|
||||
|
||||
fun create(): SManga {
|
||||
return SMangaImpl()
|
||||
return MangaImpl()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
package eu.kanade.tachiyomi.source.model
|
||||
|
||||
class SMangaImpl : SManga {
|
||||
|
||||
override lateinit var url: String
|
||||
|
||||
override lateinit var title: String
|
||||
|
||||
override var artist: String? = null
|
||||
|
||||
override var author: String? = null
|
||||
|
||||
override var description: String? = null
|
||||
|
||||
override var genre: String? = null
|
||||
|
||||
override var status: Int = 0
|
||||
|
||||
override var thumbnail_url: String? = null
|
||||
|
||||
override var initialized: Boolean = false
|
||||
|
||||
}
|
@ -247,7 +247,7 @@ class LibraryPresenter(
|
||||
}
|
||||
else -> sortAlphabetical(i1, i2)
|
||||
}
|
||||
if ((category.mangaSort!! - 'a') % 2 == 1 )
|
||||
if ((category.mangaSort?.minus('a')) ?: 0 % 2 == 1 )
|
||||
sort *= -1
|
||||
sort
|
||||
}
|
||||
|
@ -217,7 +217,11 @@ class MangaInfoPresenter(
|
||||
else {
|
||||
var changed = false
|
||||
val title = title?.trim()
|
||||
if (title.isNullOrBlank() && manga.currentTitle() != manga.originalTitle()) {
|
||||
if (!title.isNullOrBlank() && manga.originalTitle().isBlank()) {
|
||||
manga.title = title
|
||||
changed = true
|
||||
}
|
||||
else if (title.isNullOrBlank() && manga.currentTitle() != manga.originalTitle()) {
|
||||
manga.title = manga.originalTitle()
|
||||
changed = true
|
||||
} else if (!title.isNullOrBlank() && title != manga.currentTitle()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user