Skip to content

Commit

Permalink
Fix: Metadata download not working properly for Steam games
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefNemec committed Oct 19, 2018
1 parent bbdfbcb commit af015ca
Showing 1 changed file with 23 additions and 29 deletions.
52 changes: 23 additions & 29 deletions source/Plugins/SteamLibrary/Services/SteamApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,30 @@ public void Logout()

public async Task<KeyValue> GetProductInfo(uint id)
{
if (IsLoggedIn == false)
if (!IsConnected)
{
throw new Exception("Steam not loggin in.");
var connect = await Connect();
if (connect != EResult.OK)
{
connect = await Connect();
if (connect != EResult.OK)
{
throw new Exception("Failed to connect to Steam " + connect);
}
}

isConnected = true;
}

if (!IsLoggedIn)
{
var logon = await Login();
if (logon != EResult.OK)
{
throw new Exception("Failed to logon to Steam " + logon);
}

isLoggedIn = true;
}

try
Expand Down Expand Up @@ -174,32 +195,5 @@ public async Task<KeyValue> GetProductInfo(uint id)
throw new Exception("Failed to get product info for app " + id + ". " + e.Message);
}
}

public async Task<KeyValue> GetProductInfo(int id)
{
if (!IsConnected)
{
var connect = await Connect();
if (connect != EResult.OK)
{
connect = await Connect();
if (connect != EResult.OK)
{
throw new Exception("Failed to connect to Steam " + connect);
}
}
}

if (!IsLoggedIn)
{
var logon = await Login();
if (logon != EResult.OK)
{
throw new Exception("Failed to logon to Steam " + logon);
}
}

return await GetProductInfo(Convert.ToUInt32(id));
}
}
}

0 comments on commit af015ca

Please sign in to comment.