Skip to content

Commit

Permalink
Merge pull request #22 from KrystianLesniak/develop
Browse files Browse the repository at this point in the history
Release: 1.4.1
  • Loading branch information
KrystianLesniak authored Sep 16, 2023
2 parents 12567ee + ab062c0 commit 15bdf85
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/src"
schedule:
interval: "daily"
target-branch: "develop"
1 change: 1 addition & 0 deletions src/GamesLauncher.Platforms/PlatformsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using GamesLauncher.Platforms.SyncEngines;
using GamesLauncher.Platforms.SyncEngines.Amazon;
using GamesLauncher.Platforms.SyncEngines.Epic;
using GamesLauncher.Platforms.SyncEngines.Steam;
using System.Collections.Concurrent;

namespace GamesLauncher.Platforms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ private Func<ActionContext, ValueTask<bool>> GetGameRunTask(string fullPath)

private static async Task<string?> GetIconPath(FileInfo fileInfo)
{
if (fileInfo.Extension == ".lnk")
{
return fileInfo.FullName; //TODO: Take ico location path directly from lnk like it's done for url below. Flow Launcher weridly handles lnk icons
}

if (fileInfo.Extension == ".url")
{
await foreach (var line in File.ReadLinesAsync(fileInfo.FullName))
Expand All @@ -64,7 +59,7 @@ private Func<ActionContext, ValueTask<bool>> GetGameRunTask(string fullPath)
}
}

return null;
return fileInfo.FullName;
}

}
Expand Down
14 changes: 14 additions & 0 deletions src/GamesLauncher.Platforms/SyncEngines/Steam/SteamGamesConsts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Immutable;

namespace GamesLauncher.Platforms.SyncEngines.Steam
{
internal static class SteamGamesConsts
{
//TODO: When hiding games from list feature will be implemented this will be no longer needed
internal static readonly IImmutableList<uint> AppIdsToIgnore = new List<uint>()
{
228980 //Steamworks Common Redistributables
}
.ToImmutableList();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
using GameFinder.StoreHandlers.Steam;
using NexusMods.Paths;

namespace GamesLauncher.Platforms.SyncEngines
namespace GamesLauncher.Platforms.SyncEngines.Steam
{
internal class SteamSyncEngine : ISyncEngine
{
public string PlatformName => "Steam";


private readonly SteamHandler handler = new(FileSystem.Shared, WindowsRegistry.Shared);
private readonly IPublicAPI publicApi;
private const string steamLaunchUri = "steam://launch/";

public SteamSyncEngine(IPublicAPI publicApi)
{
Expand All @@ -23,7 +21,8 @@ public SteamSyncEngine(IPublicAPI publicApi)
public async IAsyncEnumerable<Game> GetGames()
{
var result = handler.FindAllGames();
var games = result.Where(x => x.IsGame()).Select(x => x.AsGame());
var games = result.Where(x => x.IsGame()).Select(x => x.AsGame())
.Where(x => SteamGamesConsts.AppIdsToIgnore.Contains(x.AppId.Value) == false);

foreach (var game in games)
{
Expand All @@ -46,7 +45,7 @@ private Game MapSteamGameToGame(SteamGame steamGame)

private Func<ActionContext, ValueTask<bool>> GetGameRunTask(string gameAppIdString)
{
var uriString = steamLaunchUri + gameAppIdString;
var uriString = $"steam://launch/{gameAppIdString}/Dialog";

return (context) =>
{
Expand Down
2 changes: 1 addition & 1 deletion src/GamesLauncher/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "GamesLauncher",
"Description": "Search and launch games from multiple platforms like Steam, Epic Games, Xbox etc.",
"Author": "KrystianLesniak",
"Version": "1.4.0",
"Version": "1.4.1",
"Language": "csharp",
"Website": "https://github.com/KrystianLesniak/Flow.Launcher.Plugin.GamesLauncher",
"IcoPath": "icon.png",
Expand Down

0 comments on commit 15bdf85

Please sign in to comment.