From 9a5d0f81ff2f73cdaac7e1bb566aa4803561cabc Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Mon, 7 Sep 2020 17:42:19 +0200
Subject: [PATCH] REPO: Re-add the upgrade (forgot to add it during the
 refactor)

---
 src/module/module_repo.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/module/module_repo.c b/src/module/module_repo.c
index fc93c722..e11cc710 100644
--- a/src/module/module_repo.c
+++ b/src/module/module_repo.c
@@ -387,9 +387,16 @@ static void *
 __worker_rescan(void *__repo)
 {
     struct module_repo_internal *repo = __repo;
+    char kara_prefix[LKT_LINE_MAX];
     lkt_queue_send(repo->queue, lkt_event_db_updating, LKT_DB_UPDATING_PROGRESS);
+    if (!database_config_get_text(repo->db, "database", "kara_dir", kara_prefix, LKT_LINE_MAX)) {
+        LOG_ERROR("REPO", "Failed to get kara prefix from config");
+        pthread_exit(NULL);
+    }
     repo->updating = 1;
-    /* Use the database_update(db, prefix, forced) function here ! */
+    database_update(repo->db, kara_prefix, 0); /* Don't check timestamp.
+                                                  TODO: Sometimes we want to check them */
+    repo->updating = 0;
     lkt_queue_send(repo->queue, lkt_event_db_updating, LKT_DB_UPDATING_FINISHED);
     pthread_exit(NULL);
 }
-- 
GitLab