diff --git a/LANCommander/Pages/Settings/Media.razor b/LANCommander/Pages/Settings/Media.razor new file mode 100644 index 0000000..005c393 --- /dev/null +++ b/LANCommander/Pages/Settings/Media.razor @@ -0,0 +1,67 @@ +@page "/Settings/Media" +@using LANCommander.Components.FileManagerComponents; +@using LANCommander.Models; +@layout SettingsLayout +@inject SettingService SettingService +@inject IMessageService MessageService +@attribute [Authorize(Roles = "Administrator")] + + + +
+
+ + + + + + + + + + + In order to automatically search SteamGridDB for media, you need an API key. Click here to get your key. + + + + + + + + + +
+ +@code { + LANCommanderSettings Settings; + + string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory()); + + protected override async Task OnInitializedAsync() + { + Settings = SettingService.GetSettings(); + } + + private void Save() + { + try + { + SettingService.SaveSettings(Settings); + MessageService.Success("Settings saved!"); + } + catch + { + MessageService.Error("An unknown error occurred."); + } + } + + private void OnPathSelected(string path) + { + var appPath = Directory.GetCurrentDirectory(); + + if (path != null && path.StartsWith(appPath)) + path = path.Substring(appPath.Length).TrimStart(Path.DirectorySeparatorChar).TrimEnd(Path.DirectorySeparatorChar); + + Settings.Archives.StoragePath = path; + } +} diff --git a/LANCommander/Pages/Settings/SettingsLayout.razor b/LANCommander/Pages/Settings/SettingsLayout.razor index 335e07b..928bdde 100644 --- a/LANCommander/Pages/Settings/SettingsLayout.razor +++ b/LANCommander/Pages/Settings/SettingsLayout.razor @@ -10,6 +10,7 @@ Authentication User Saves Archives + Media IPX Relay Beacon Tools