This commit is contained in:
Amine 2018-11-04 14:37:22 +01:00
parent f49256c72f
commit 7292edf997
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
**1.7.x** **1.7.x**
- Closes #179. Sync of read/unread/star/unstar items on background task or on app reload with network available.
- Closes #33. Background sync with settings. - Closes #33. Background sync with settings.
- Closing #1. Initial article caching. - Closing #1. Initial article caching.

View File

@ -29,6 +29,7 @@ import kotlin.concurrent.schedule
import kotlin.concurrent.thread import kotlin.concurrent.thread
class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(context, params) { class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(context, params) {
lateinit var db: AppDatabase
override fun doWork(): Result { override fun doWork(): Result {
if (context.isNetworkAccessible(null)) { if (context.isNetworkAccessible(null)) {
@ -51,7 +52,7 @@ class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(con
val sharedPref = PreferenceManager.getDefaultSharedPreferences(this.context) val sharedPref = PreferenceManager.getDefaultSharedPreferences(this.context)
val shouldLogEverything = sharedPref.getBoolean("should_log_everything", false) val shouldLogEverything = sharedPref.getBoolean("should_log_everything", false)
val db = Room.databaseBuilder( db = Room.databaseBuilder(
applicationContext, applicationContext,
AppDatabase::class.java, "selfoss-database" AppDatabase::class.java, "selfoss-database"
).addMigrations(MIGRATION_1_2).addMigrations(MIGRATION_2_3).build() ).addMigrations(MIGRATION_1_2).addMigrations(MIGRATION_2_3).build()