From 88bc88dc5a5b4a87c23f3913349a1a161921ce6f Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Fri, 12 May 2023 01:56:15 +0800 Subject: [PATCH] migrate meilisearch config --- include/constants.php | 2 +- nexus/Install/Update.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/constants.php b/include/constants.php index c7a3c879..c6e72adb 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ doLog("removeDuplicatePeer and migrate 2023_04_01_005409_add_unique_torrent_peer_user_to_peers_table"); } + /** + * @since 1.8.3 + */ + if (NexusDB::hasTable('settings')) { + $updateSettings = []; + if (get_setting("system.meilisearch_enabled") == 'yes') { + $updateSettings["enabled"] = "yes"; + } + if (get_setting("system.meilisearch_search_description") == 'yes') { + $updateSettings["search_description"] = "yes"; + } + if (!empty($updateSettings)) { + $this->saveSettings(['meilisearch' => $updateSettings]); + } + } }