summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-21 11:56:19 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-21 11:56:19 -0500
commit02f645900eb31648376abe21df30dd956221ad90 (patch)
tree2e80f56ec0995398200365fa263bc44655f1eea0 /src/SMAPI.Web/Framework
parent9dc6054479da664ea82ec366215ba79c36bfca2c (diff)
downloadSMAPI-02f645900eb31648376abe21df30dd956221ad90.tar.gz
SMAPI-02f645900eb31648376abe21df30dd956221ad90.tar.bz2
SMAPI-02f645900eb31648376abe21df30dd956221ad90.zip
add option to disable uploading new files to Pastebin
Diffstat (limited to 'src/SMAPI.Web/Framework')
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs3
-rw-r--r--src/SMAPI.Web/Framework/Storage/StorageProvider.cs3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
index 1e020840..e88f351f 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
@@ -97,5 +97,8 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
/// <summary>The developer key used to authenticate with the Pastebin API.</summary>
public string PastebinDevKey { get; set; }
+ /// <summary>Whether to enable uploading new files to Pastebin. This doesn't affect fetching already-uploaded files.</summary>
+ public bool PastebinEnableUploads { get; set; }
+
}
}
diff --git a/src/SMAPI.Web/Framework/Storage/StorageProvider.cs b/src/SMAPI.Web/Framework/Storage/StorageProvider.cs
index bbb6e06b..e5e71325 100644
--- a/src/SMAPI.Web/Framework/Storage/StorageProvider.cs
+++ b/src/SMAPI.Web/Framework/Storage/StorageProvider.cs
@@ -52,7 +52,8 @@ namespace StardewModdingAPI.Web.Framework.Storage
public async Task<UploadResult> SaveAsync(string title, string content, bool compress = true)
{
// save to PasteBin
- string uploadError;
+ string uploadError = null;
+ if (this.ClientsConfig.PastebinEnableUploads)
{
SavePasteResult result = await this.Pastebin.PostAsync(title, content);
if (result.Success)