diff --git a/Classes/Uploaders/RePlaysUploader.cs b/Classes/Uploaders/RePlaysUploader.cs index 085618af..e97eea2d 100644 --- a/Classes/Uploaders/RePlaysUploader.cs +++ b/Classes/Uploaders/RePlaysUploader.cs @@ -66,10 +66,13 @@ public override async Task Upload(string id, string title, string file, Logger.WriteLine(response.StatusCode.ToString() + " " + content); var result = JsonSerializer.Deserialize(content); if (result.shortcode != null) { - Process browserProcess = new Process(); - browserProcess.StartInfo.UseShellExecute = true; - browserProcess.StartInfo.FileName = "https://replays.app/Video/" + result.shortcode; - browserProcess.Start(); + if (SettingsService.Settings.uploadSettings.openAfterUpload) { + Process browserProcess = new Process(); + browserProcess.StartInfo.UseShellExecute = true; + browserProcess.StartInfo.FileName = "https://replays.app/Video/" + result.shortcode; + browserProcess.Start(); + } + return "https://replays.app/Video/" + result.shortcode; } diff --git a/Classes/Uploaders/StreamableUploader.cs b/Classes/Uploaders/StreamableUploader.cs index 7bde8541..839aa1ff 100644 --- a/Classes/Uploaders/StreamableUploader.cs +++ b/Classes/Uploaders/StreamableUploader.cs @@ -1,6 +1,7 @@ using RePlays.Services; using RePlays.Utils; using System; +using System.Diagnostics; using System.IO; using System.Net.Http; using System.Net.Http.Headers; @@ -41,6 +42,13 @@ public override async Task Upload(string id, string title, string file, Logger.WriteLine(response.StatusCode.ToString() + " " + content); var result = JsonSerializer.Deserialize(content); if (result.shortcode != null) { + if (SettingsService.Settings.uploadSettings.openAfterUpload) { + Process browserProcess = new Process(); + browserProcess.StartInfo.UseShellExecute = true; + browserProcess.StartInfo.FileName = "https://streamable.com/" + result.shortcode; + browserProcess.Start(); + } + return "https://streamable.com/" + result.shortcode; } else { diff --git a/Classes/Utils/JSONObjects.cs b/Classes/Utils/JSONObjects.cs index 2b9c704e..1564c8ef 100644 --- a/Classes/Utils/JSONObjects.cs +++ b/Classes/Utils/JSONObjects.cs @@ -235,6 +235,8 @@ public class StorageSettings { public class UploadSettings { private List _recentLinks = new(); public List recentLinks { get { return _recentLinks; } set { _recentLinks = value; } } + private bool _openAfterUpload = true; + public bool openAfterUpload { get { return _openAfterUpload; } set { _openAfterUpload = value; } } public class StreamableSettings { private string _email = ""; diff --git a/ClientApp/src/index.tsx b/ClientApp/src/index.tsx index 28adaf10..5bce16d0 100644 --- a/ClientApp/src/index.tsx +++ b/ClientApp/src/index.tsx @@ -168,6 +168,7 @@ declare global { } interface UploadSettings { recentLinks: string[]; + openAfterUpload: boolean; streamableSettings: { email: string; password: string; diff --git a/ClientApp/src/internationalization/locales/en.json b/ClientApp/src/internationalization/locales/en.json index 7c509ac8..68552871 100644 --- a/ClientApp/src/internationalization/locales/en.json +++ b/ClientApp/src/internationalization/locales/en.json @@ -101,6 +101,7 @@ "settingsUploadItem17": "Response Path", "settingsUploadItem18": "The url to the video using", "settingsUploadItem19": "Streamable.com", + "settingsUploadItem20": "Open In Browser After Upload", "settingsStorageItem01": "Save Locations", "settingsStorageItem02": "Game Recordings Directory", "settingsStorageItem03": "Open Folder", diff --git a/ClientApp/src/pages/Settings/Upload.tsx b/ClientApp/src/pages/Settings/Upload.tsx index b848de95..0efc085d 100644 --- a/ClientApp/src/pages/Settings/Upload.tsx +++ b/ClientApp/src/pages/Settings/Upload.tsx @@ -110,6 +110,20 @@ const RePlays: React.FC = ({ settings, updateSettings }) => { }} /> + { postMessage('OpenLink', 'https://replays.app'); @@ -155,6 +169,20 @@ const Streamable: React.FC = ({ settings, updateSettings }) => { }} /> + { postMessage('OpenLink', 'https://streamable.com/');