Use correct HBrowse source id
This commit is contained in:
parent
6f6490b7ac
commit
0759036536
@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.source.online.HttpSource
|
|||||||
import eu.kanade.tachiyomi.source.online.LewdSource
|
import eu.kanade.tachiyomi.source.online.LewdSource
|
||||||
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
import eu.kanade.tachiyomi.source.online.UrlImportableSource
|
||||||
import eu.kanade.tachiyomi.util.asJsoup
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import exh.HBROWSE_SOURCE_ID
|
||||||
import exh.metadata.metadata.HBrowseSearchMetadata
|
import exh.metadata.metadata.HBrowseSearchMetadata
|
||||||
import exh.metadata.metadata.base.RaisedTag
|
import exh.metadata.metadata.base.RaisedTag
|
||||||
import exh.search.Namespace
|
import exh.search.Namespace
|
||||||
@ -50,6 +51,8 @@ class HBrowse : HttpSource(), LewdSource<HBrowseSearchMetadata, Document>, UrlIm
|
|||||||
|
|
||||||
override val metaClass = HBrowseSearchMetadata::class
|
override val metaClass = HBrowseSearchMetadata::class
|
||||||
|
|
||||||
|
override val id: Long = HBROWSE_SOURCE_ID
|
||||||
|
|
||||||
override fun headersBuilder() = Headers.Builder()
|
override fun headersBuilder() = Headers.Builder()
|
||||||
.add("Cookie", BASE_COOKIES)
|
.add("Cookie", BASE_COOKIES)
|
||||||
|
|
||||||
|
@ -77,6 +77,21 @@ object EXHMigrations {
|
|||||||
backupDatabase(context, oldVersion)
|
backupDatabase(context, oldVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Backup database in next release
|
||||||
|
if (oldVersion < 8405) {
|
||||||
|
db.inTransaction {
|
||||||
|
// Migrate HBrowse source IDs
|
||||||
|
db.lowLevel().executeSQL(RawQuery.builder()
|
||||||
|
.query("""
|
||||||
|
UPDATE ${MangaTable.TABLE}
|
||||||
|
SET ${MangaTable.COL_SOURCE} = $HBROWSE_SOURCE_ID
|
||||||
|
WHERE ${MangaTable.COL_SOURCE} = 1401584337232758222
|
||||||
|
""".trimIndent())
|
||||||
|
.affectsTables(MangaTable.TABLE)
|
||||||
|
.build())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO BE CAREFUL TO NOT FUCK UP MergedSources IF CHANGING URLs
|
// TODO BE CAREFUL TO NOT FUCK UP MergedSources IF CHANGING URLs
|
||||||
|
|
||||||
preferences.eh_lastVersionCode().set(BuildConfig.VERSION_CODE)
|
preferences.eh_lastVersionCode().set(BuildConfig.VERSION_CODE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user