mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 03:31:49 +01:00
Removing hide title from manga
Since there's comfortable grid there's no need for it now
This commit is contained in:
parent
26571a2508
commit
00bd80b5fa
@ -69,9 +69,6 @@ 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)
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ import eu.kanade.tachiyomi.data.database.tables.MangaTable.COL_CHAPTER_FLAGS
|
||||
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
|
||||
@ -63,7 +62,6 @@ 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(MangaTable.COL_DATE_ADDED, obj.date_added)
|
||||
}
|
||||
@ -86,7 +84,6 @@ 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(MangaTable.COL_DATE_ADDED))
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,6 @@ 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)
|
||||
|
@ -38,8 +38,6 @@ 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) {
|
||||
|
@ -9,7 +9,6 @@ import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.LibraryMangaGetResolver
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.MangaFavoritePutResolver
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.MangaFlagsPutResolver
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.MangaHideTitlePutResolver
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.MangaInfoPutResolver
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.MangaLastUpdatedPutResolver
|
||||
import eu.kanade.tachiyomi.data.database.resolvers.MangaTitlePutResolver
|
||||
@ -98,11 +97,6 @@ interface MangaQueries : DbProvider {
|
||||
.withPutResolver(MangaViewerPutResolver())
|
||||
.prepare()
|
||||
|
||||
fun updateMangaHideTitle(manga: Manga) = db.put()
|
||||
.`object`(manga)
|
||||
.withPutResolver(MangaHideTitlePutResolver())
|
||||
.prepare()
|
||||
|
||||
fun updateMangaTitle(manga: Manga) = db.put()
|
||||
.`object`(manga)
|
||||
.withPutResolver(MangaTitlePutResolver())
|
||||
|
@ -1,31 +0,0 @@
|
||||
package eu.kanade.tachiyomi.data.database.resolvers
|
||||
|
||||
import android.content.ContentValues
|
||||
import com.pushtorefresh.storio.sqlite.StorIOSQLite
|
||||
import com.pushtorefresh.storio.sqlite.operations.put.PutResolver
|
||||
import com.pushtorefresh.storio.sqlite.operations.put.PutResult
|
||||
import com.pushtorefresh.storio.sqlite.queries.UpdateQuery
|
||||
import eu.kanade.tachiyomi.data.database.inTransactionReturn
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.database.tables.MangaTable
|
||||
|
||||
class MangaHideTitlePutResolver : PutResolver<Manga>() {
|
||||
|
||||
override fun performPut(db: StorIOSQLite, manga: Manga) = db.inTransactionReturn {
|
||||
val updateQuery = mapToUpdateQuery(manga)
|
||||
val contentValues = mapToContentValues(manga)
|
||||
|
||||
val numberOfRowsUpdated = db.lowLevel().update(updateQuery, contentValues)
|
||||
PutResult.newUpdateResult(numberOfRowsUpdated, updateQuery.table())
|
||||
}
|
||||
|
||||
fun mapToUpdateQuery(manga: Manga) = UpdateQuery.builder()
|
||||
.table(MangaTable.TABLE)
|
||||
.where("${MangaTable.COL_ID} = ?")
|
||||
.whereArgs(manga.id)
|
||||
.build()
|
||||
|
||||
fun mapToContentValues(manga: Manga) = ContentValues(1).apply {
|
||||
put(MangaTable.COL_HIDE_TITLE, manga.hide_title)
|
||||
}
|
||||
}
|
@ -38,8 +38,6 @@ object MangaTable {
|
||||
|
||||
const val COL_CATEGORY = "category"
|
||||
|
||||
const val COL_HIDE_TITLE = "hideTitle"
|
||||
|
||||
const val COL_DATE_ADDED = "date_added"
|
||||
|
||||
val createTableQuery: String
|
||||
@ -58,7 +56,6 @@ 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
|
||||
|
||||
@ -71,9 +68,6 @@ 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"
|
||||
}
|
||||
|
@ -747,15 +747,6 @@ class LibraryPresenter(
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
fun hideShowTitle(mangas: List<Manga>, hide: Boolean) {
|
||||
mangas.forEach { it.hide_title = hide }
|
||||
db.inTransaction {
|
||||
mangas.forEach {
|
||||
db.updateMangaHideTitle(it).executeAsBlocking()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun migrateMangaInternal(
|
||||
source: Source,
|
||||
sourceChapters: List<SChapter>,
|
||||
|
Loading…
Reference in New Issue
Block a user