From 13d2fbb49c61d0fd4003e80571c1bc942a0e6dc1 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Thu, 18 Nov 2021 11:38:13 +0100
Subject: [PATCH] LKT: Add the dry-update command to lkt

---
 man/lkt.template | 5 +++++
 src/main/lkt.c   | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/man/lkt.template b/man/lkt.template
index 625fa7d8..2808af5d 100644
--- a/man/lkt.template
+++ b/man/lkt.template
@@ -212,6 +212,11 @@ to bootstrap the database from a filesystem
 Update the base from the \fIKurisu\fP repo. Don't scan for new files in
 the filesystem
 .TP
+\fadmin dry-update\fP
+Dry update the base from \fIKurisu\fP. Don't modify metadata of already existing
+karas and don't delete local karas that where deleted on \fIKurisu\fP. Only add
+as unavailable new karas from \fIKurisu\fP
+.TP
 \fBadmin import\fP
 Import favorites from the \fIKurisu\fP repo. Favorites will create playlists on
 the lektor side begening with the @ character
diff --git a/src/main/lkt.c b/src/main/lkt.c
index b03d1554..2458e45e 100644
--- a/src/main/lkt.c
+++ b/src/main/lkt.c
@@ -455,6 +455,7 @@ rescan_or_update__(struct cmd_args *args, const char *cmd)
 // clang-format off
 ___just_send_with_password(rescan__, "rescan");
 ___just_send_with_password(update__, "update");
+___just_send_with_password(dry_update__, "__dry_update");
 ___just_send_with_password(import__, "__import");
 ___just_send_with_password(populate__, "__rescan");
 // clang-format on
@@ -1250,6 +1251,7 @@ static struct cmd_opt options_admin[] = {
     { .name = "restart",    .call = restart__           },
     { .name = "rescan",     .call = rescan__            },
     { .name = "update",     .call = update__            },
+    { .name = "dry-update", .call = dry_update__        },
     { .name = "populate",   .call = populate__          },
     { .name = "config",     .call = config__            },
     { .name = "import",     .call = import__            },
-- 
GitLab