From 0de515712af6db1d4615da801f62a304e04ad194 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Mon, 20 May 2024 11:11:40 +0200 Subject: [PATCH] QOL for Remote --- RemoteDownloaderPlugin/Game/GameDownload.cs | 3 ++- RemoteDownloaderPlugin/Game/InstalledGame.cs | 11 +++-------- RemoteDownloaderPlugin/Remote.cs | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/RemoteDownloaderPlugin/Game/GameDownload.cs b/RemoteDownloaderPlugin/Game/GameDownload.cs index 4b3132b..3a58df5 100644 --- a/RemoteDownloaderPlugin/Game/GameDownload.cs +++ b/RemoteDownloaderPlugin/Game/GameDownload.cs @@ -53,7 +53,8 @@ private async Task DownloadEmu(IApp app, EmuEntry entry) { throw new Exception("Multiple base images, impossible download"); } - + + Line2 = $"{entry.Files.Count(x => x.Type == "base")} base, {entry.Files.Count(x => x.Type == "update")} update, {entry.Files.Count(x => x.Type == "dlc")} dlc"; var basePath = Path.Join(app.GameDir, "Remote", entry.Emu); string baseGamePath = null; var extraFilesPath = Path.Join(app.GameDir, "Remote", entry.Emu, entry.GameId); diff --git a/RemoteDownloaderPlugin/Game/InstalledGame.cs b/RemoteDownloaderPlugin/Game/InstalledGame.cs index 4fe6a02..8d08c41 100644 --- a/RemoteDownloaderPlugin/Game/InstalledGame.cs +++ b/RemoteDownloaderPlugin/Game/InstalledGame.cs @@ -148,14 +148,9 @@ public void Delete() public void OpenInFileManager() { - if (_type == GameType.Emu) - { - LauncherGamePlugin.Utils.OpenFolderWithHighlightedFile(Path.Join(_plugin.App.GameDir, "Remote", _emuGame!.Emu, _emuGame.BaseFilename)); - } - else - { - LauncherGamePlugin.Utils.OpenFolder(Path.Join(_plugin.App.GameDir, "Remote", "Pc", Game.Id)); - } + LauncherGamePlugin.Utils.OpenFolder(_type == GameType.Emu + ? Path.Join(_plugin.App.GameDir, "Remote", _emuGame!.Emu) + : Path.Join(_plugin.App.GameDir, "Remote", "Pc", Game.Id)); } private Uri? ImageTypeToUri(ImageType type) diff --git a/RemoteDownloaderPlugin/Remote.cs b/RemoteDownloaderPlugin/Remote.cs index 98934c7..b833778 100644 --- a/RemoteDownloaderPlugin/Remote.cs +++ b/RemoteDownloaderPlugin/Remote.cs @@ -41,7 +41,7 @@ public class EmuEntry : IEntry public string Emu { get; set; } [System.Text.Json.Serialization.JsonIgnore] - public long GameSize => Files.FirstOrDefault(x => x.Type == "base")?.DownloadSize ?? 0; + public long GameSize => Files.Sum(x => x.DownloadSize); } public class PcEntry : IEntry