diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt index 7fbd7089a2..9f4df849e7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/DbOpenCallback.kt @@ -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) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/mappers/MangaTypeMapping.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/mappers/MangaTypeMapping.kt index 42b82ddd50..266b57f1e5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/mappers/MangaTypeMapping.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/mappers/MangaTypeMapping.kt @@ -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() { 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)) } } 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 e3b07bb95e..811d035cdb 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 @@ -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) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt index 82dfcefd36..e0f87ed1fa 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/MangaImpl.kt @@ -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) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/MangaQueries.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/MangaQueries.kt index 5f6323efee..6074cc030e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/MangaQueries.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/queries/MangaQueries.kt @@ -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()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaHideTitlePutResolver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaHideTitlePutResolver.kt deleted file mode 100644 index 69f76275a4..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaHideTitlePutResolver.kt +++ /dev/null @@ -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() { - - 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) - } -} diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/tables/MangaTable.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/tables/MangaTable.kt index 27a087b3c2..f992088a19 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/tables/MangaTable.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/tables/MangaTable.kt @@ -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" } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 13b810950d..ebf5ed8df8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -747,15 +747,6 @@ class LibraryPresenter( .subscribe() } - fun hideShowTitle(mangas: List, hide: Boolean) { - mangas.forEach { it.hide_title = hide } - db.inTransaction { - mangas.forEach { - db.updateMangaHideTitle(it).executeAsBlocking() - } - } - } - private fun migrateMangaInternal( source: Source, sourceChapters: List,