Readding Hide Table Column

Since it fails to load browse without it
This commit is contained in:
Jay 2020-04-11 13:58:40 -04:00
parent d5605d162c
commit 3cd74ce05e
5 changed files with 17 additions and 1 deletions

View File

@ -69,6 +69,9 @@ class DbOpenCallback : SupportSQLiteOpenHelper.Callback(DATABASE_VERSION) {
db.execSQL(MangaTable.createLibraryIndexQuery)
db.execSQL(ChapterTable.createUnreadChaptersIndexQuery)
}
if (oldVersion < 9) {
db.execSQL(MangaTable.addHideTitle)
}
if (oldVersion < 10) {
db.execSQL(CategoryTable.addMangaOrder)
}

View File

@ -18,6 +18,7 @@ import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_DATE_ADDED
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_DESCRIPTION
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_FAVORITE
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_GENRE
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_HIDE_TITLE
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_ID
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_INITIALIZED
import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_LAST_UPDATE
@ -62,6 +63,7 @@ class MangaPutResolver : DefaultPutResolver<Manga>() {
put(COL_LAST_UPDATE, obj.last_update)
put(COL_INITIALIZED, obj.initialized)
put(COL_VIEWER, obj.viewer)
put(COL_HIDE_TITLE, obj.hide_title)
put(COL_CHAPTER_FLAGS, obj.chapter_flags)
put(COL_DATE_ADDED, obj.date_added)
}
@ -84,6 +86,7 @@ interface BaseMangaGetResolver {
initialized = cursor.getInt(cursor.getColumnIndex(COL_INITIALIZED)) == 1
viewer = cursor.getInt(cursor.getColumnIndex(COL_VIEWER))
chapter_flags = cursor.getInt(cursor.getColumnIndex(COL_CHAPTER_FLAGS))
hide_title = cursor.getInt(cursor.getColumnIndex(COL_HIDE_TITLE)) == 1
date_added = cursor.getLong(cursor.getColumnIndex(COL_DATE_ADDED))
}
}

View File

@ -25,6 +25,8 @@ interface Manga : SManga {
var chapter_flags: Int
var hide_title: Boolean
fun setChapterOrder(order: Int) {
setFlags(order, SORT_MASK)
setFlags(SORT_LOCAL, SORT_SELF_MASK)

View File

@ -38,6 +38,8 @@ open class MangaImpl : Manga {
override var chapter_flags: Int = 0
override var hide_title: Boolean = false
override var date_added: Long = 0
override fun copyFrom(other: SManga) {

View File

@ -38,6 +38,8 @@ object MangaTable {
const val COL_CATEGORY = "category"
const val COL_HIDE_TITLE = "hideTitle"
const val COL_DATE_ADDED = "date_added"
val createTableQuery: String
@ -56,6 +58,7 @@ object MangaTable {
$COL_LAST_UPDATE LONG,
$COL_INITIALIZED BOOLEAN NOT NULL,
$COL_VIEWER INTEGER NOT NULL,
$COL_HIDE_TITLE INTEGER NOT NULL,
$COL_CHAPTER_FLAGS INTEGER NOT NULL,
$COL_DATE_ADDED LONG
@ -68,6 +71,9 @@ object MangaTable {
get() = "CREATE INDEX library_${COL_FAVORITE}_index ON $TABLE($COL_FAVORITE) " +
"WHERE $COL_FAVORITE = 1"
val addHideTitle: String
get() = "ALTER TABLE $TABLE ADD COLUMN $COL_HIDE_TITLE INTEGER DEFAULT 0"
val addDateAddedCol: String
get() = "ALTER TABLE ${MangaTable.TABLE} ADD COLUMN ${MangaTable.COL_DATE_ADDED} LONG DEFAULT 0"
get() = "ALTER TABLE $TABLE ADD COLUMN $COL_DATE_ADDED LONG DEFAULT 0"
}