mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-25 01:11:13 +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
|
package eu.kanade.tachiyomi.data.database.models
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import java.lang.Exception
|
|
||||||
|
|
||||||
open class MangaImpl : Manga {
|
open class MangaImpl : Manga {
|
||||||
|
|
||||||
@ -38,16 +37,14 @@ open class MangaImpl : Manga {
|
|||||||
override var hide_title: Boolean = false
|
override var hide_title: Boolean = false
|
||||||
|
|
||||||
override fun copyFrom(other: SManga) {
|
override fun copyFrom(other: SManga) {
|
||||||
try {
|
if (other is MangaImpl && (other as MangaImpl)::title.isInitialized && !other.title
|
||||||
if (other.title != title) {
|
.isBlank()) {
|
||||||
title = if (currentTitle() != originalTitle()) {
|
title = if (currentTitle() != originalTitle()) {
|
||||||
val customTitle = currentTitle()
|
val customTitle = currentTitle()
|
||||||
val trueTitle = other.title
|
val trueTitle = other.title
|
||||||
"${customTitle}${SManga.splitter}${trueTitle}"
|
"${customTitle}${SManga.splitter}${trueTitle}"
|
||||||
} else other.title
|
} else other.title
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(e: Exception) { }
|
|
||||||
super.copyFrom(other)
|
super.copyFrom(other)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package eu.kanade.tachiyomi.source.model
|
package eu.kanade.tachiyomi.source.model
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.data.database.models.MangaImpl
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface SManga : Serializable {
|
interface SManga : Serializable {
|
||||||
@ -100,7 +101,7 @@ interface SManga : Serializable {
|
|||||||
const val splitter = "▒ ▒∩▒"
|
const val splitter = "▒ ▒∩▒"
|
||||||
|
|
||||||
fun create(): SManga {
|
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)
|
else -> sortAlphabetical(i1, i2)
|
||||||
}
|
}
|
||||||
if ((category.mangaSort!! - 'a') % 2 == 1 )
|
if ((category.mangaSort?.minus('a')) ?: 0 % 2 == 1 )
|
||||||
sort *= -1
|
sort *= -1
|
||||||
sort
|
sort
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,11 @@ class MangaInfoPresenter(
|
|||||||
else {
|
else {
|
||||||
var changed = false
|
var changed = false
|
||||||
val title = title?.trim()
|
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()
|
manga.title = manga.originalTitle()
|
||||||
changed = true
|
changed = true
|
||||||
} else if (!title.isNullOrBlank() && title != manga.currentTitle()) {
|
} else if (!title.isNullOrBlank() && title != manga.currentTitle()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user