Skip to content

Commit

Permalink
Fix: Some Steam games not importing properly #144
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefNemec committed Oct 8, 2017
1 parent c4c68d1 commit 0e0dec3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions source/Playnite/Providers/Steam/SteamLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public List<IGame> GetInstalledGamesFromFolder(string path)
catch (Exception exc)
{
// Steam can generate invalid acf file according to issue #37
logger.Error(exc, "Failed to get information about installed game from {0}: ", path);
logger.Error(exc, "Failed to get information about installed game from {0}: ", file);
}
}

Expand Down Expand Up @@ -129,6 +129,12 @@ public List<IGame> GetLibraryGames(string userName)

foreach (var game in (new ServicesClient()).GetSteamLibrary(userName))
{
// Ignore games without name, like 243870
if (string.IsNullOrEmpty(game.name))
{
continue;
}

games.Add(new Game()
{
Provider = Provider.Steam,
Expand Down Expand Up @@ -252,7 +258,7 @@ public SteamGameMetadata DownloadGameMetadata(int id)
public SteamGameMetadata UpdateGameWithMetadata(IGame game)
{
var metadata = DownloadGameMetadata(int.Parse(game.ProviderId));
game.Name = metadata.ProductDetails["common"]["name"].Value;
game.Name = metadata.ProductDetails["common"]["name"].Value ?? game.Name;
game.Links = new ObservableCollection<Link>()
{
new Link("Forum", @"https://steamcommunity.com/app/" + game.ProviderId),
Expand Down
10 changes: 8 additions & 2 deletions source/PlayniteUI/GamesCollectionView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,16 @@ private bool Filter(object item)
}
else
{
textResult = (game.Name.IndexOf(Settings.FilterSettings.Name, StringComparison.OrdinalIgnoreCase) >= 0);
if (string.IsNullOrEmpty(game.Name))
{
textResult = false;
}
else
{
textResult = (game.Name.IndexOf(Settings.FilterSettings.Name, StringComparison.OrdinalIgnoreCase) >= 0);
}
}


// ------------------ Genre
bool genreResult = false;
if (Settings.FilterSettings.Genres == null || Settings.FilterSettings.Genres.Count == 0)
Expand Down

0 comments on commit 0e0dec3

Please sign in to comment.