Move CookiesDatabase out of EhDatabase
This commit is contained in:
1 parent
f8a0d8b9c5
commit
a69edd5c55
2 files changed
+3
-6
No files matched your search
@@ -83,10 +83,6 @@ fun buildMainDB(context: Context): EhDatabase {
|
||||
return Room.databaseBuilder(context, EhDatabase::class.java, "eh.db").allowMainThreadQueries().build()
|
||||
}
|
||||
|
||||
fun buildCookiesDB(context: Context): CookiesDatabase {
|
||||
return Room.databaseBuilder(context, CookiesDatabase::class.java, "okhttp3-cookie.db").build()
|
||||
}
|
||||
|
||||
@Database(
|
||||
entities = [Search::class],
|
||||
version = 2,
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
package com.hippo.ehviewer.network
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import com.hippo.ehviewer.dao.Cookie
|
||||
import com.hippo.ehviewer.dao.buildCookiesDB
|
||||
import com.hippo.ehviewer.dao.CookiesDatabase
|
||||
import okhttp3.Cookie as OkHttpCookie
|
||||
|
||||
class CookieDatabase(context: Context) {
|
||||
@@ -30,7 +31,7 @@ class CookieDatabase(context: Context) {
|
||||
}
|
||||
}.toMutableList()
|
||||
}
|
||||
private val db = buildCookiesDB(context)
|
||||
private val db = Room.databaseBuilder(context, CookiesDatabase::class.java, "okhttp3-cookie.db").build()
|
||||
|
||||
val allCookies by lazy {
|
||||
hashMapOf<String, CookieSet>().also { map ->
|
||||
|
||||
Reference in new issue
Block a user