From f44b36267d8c44af53fec1f491ca70f77f5ecf77 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sun, 7 Jul 2019 08:06:16 +0200 Subject: [PATCH] Improved the GitHub "download data" messages added a message to tell the download is done made the "could not connect" message only show if isLogGitHubDownloadData() is set to true --- .../world/bentobox/bentobox/managers/WebManager.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/WebManager.java b/src/main/java/world/bentobox/bentobox/managers/WebManager.java index dab0efd5b..832633d00 100644 --- a/src/main/java/world/bentobox/bentobox/managers/WebManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/WebManager.java @@ -70,11 +70,18 @@ public class WebManager { topicsContent = repo.getContent("catalog/topics.json").getContent().replaceAll("\\n", ""); catalogContent = repo.getContent("catalog/catalog.json").getContent().replaceAll("\\n", ""); } catch (IllegalAccessException e) { - plugin.log("Could not connect to GitHub."); + if (plugin.getSettings().isLogGithubDownloadData()) { + plugin.log("Could not connect to GitHub."); + } } catch (Exception e) { - plugin.logError("An error occurred when downloading from GitHub..."); + plugin.logError("An error occurred when downloading data from GitHub..."); plugin.logStacktrace(e); } + + // People were concerned that the download took ages, so we need to tell them it's over now. + if (plugin.getSettings().isLogGithubDownloadData()) { + plugin.log("Successfully downloaded data from GitHub."); + } // Decoding the Base64 encoded contents tagsContent = new String(Base64.getDecoder().decode(tagsContent), StandardCharsets.UTF_8);