Skip to content

Commit 2bd57f4

Browse files
SGDB: Only allow editing covers for installed games
1 parent ddd6e8a commit 2bd57f4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

SteamGridDbMiddleware/Middleware.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using LauncherGamePlugin.Commands;
2+
using LauncherGamePlugin.Enums;
23
using LauncherGamePlugin.Interfaces;
34
using LauncherGamePlugin.Launcher;
45
using SteamGridDbMiddleware.Gui;
@@ -24,14 +25,14 @@ public async Task<List<IGame>> GetGames(IGameSource next)
2425
public List<Command> GetGameCommands(IGame game, IGameSource next)
2526
{
2627
List<Command> commands = new(next.GetGameCommands(game));
28+
29+
if (_instance.Api == null || game.InstalledStatus != InstalledStatus.Installed)
30+
return commands;
2731

28-
if (_instance.Api != null)
29-
{
30-
commands.Add(new Command());
31-
commands.AddRange(SteamGridDb.ImageTypes
32-
.Select(x => new Command($"Edit {x}", () => new OnImageEdit(game, _instance, x).ShowGui()))
33-
.ToList());
34-
}
32+
commands.Add(new Command());
33+
commands.AddRange(SteamGridDb.ImageTypes
34+
.Select(x => new Command($"Edit {x}", () => new OnImageEdit(game, _instance, x).ShowGui()))
35+
.ToList());
3536

3637
return commands;
3738
}

0 commit comments

Comments
 (0)