From 7292edf99775f23026264b1906fc209d19372536 Mon Sep 17 00:00:00 2001 From: Amine Date: Sun, 4 Nov 2018 14:37:22 +0100 Subject: [PATCH] #Closes #179. --- CHANGELOG.md | 2 ++ .../apps/amine/bou/readerforselfoss/background/background.kt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f66506e..9c3b0d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ **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. - Closing #1. Initial article caching. diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/background/background.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/background/background.kt index e63edb1..eebecb2 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/background/background.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/background/background.kt @@ -29,6 +29,7 @@ import kotlin.concurrent.schedule import kotlin.concurrent.thread class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(context, params) { + lateinit var db: AppDatabase override fun doWork(): Result { if (context.isNetworkAccessible(null)) { @@ -51,7 +52,7 @@ class LoadingWorker(val context: Context, params: WorkerParameters) : Worker(con val sharedPref = PreferenceManager.getDefaultSharedPreferences(this.context) val shouldLogEverything = sharedPref.getBoolean("should_log_everything", false) - val db = Room.databaseBuilder( + db = Room.databaseBuilder( applicationContext, AppDatabase::class.java, "selfoss-database" ).addMigrations(MIGRATION_1_2).addMigrations(MIGRATION_2_3).build()