Decode game names, closes #99

This commit is contained in:
JustArchi
2016-02-05 18:19:06 +01:00
parent b20423e415
commit 3b610432ec
2 changed files with 13 additions and 1 deletions

View File

@@ -118,7 +118,10 @@ namespace ArchiSteamFarm {
}
foreach (KeyValue lineItem in ReceiptInfo["lineitems"].Children) {
Items.Add((uint) lineItem["PackageID"].AsUnsignedLong(), lineItem["ItemDescription"].AsString());
uint appID = (uint) lineItem["PackageID"].AsUnsignedLong();
string gameName = lineItem["ItemDescription"].AsString();
gameName = Utilities.UrlDecode(gameName); // Apparently steam expects client to decode sent HTML
Items.Add(appID, gameName);
}
}
}

View File

@@ -22,6 +22,7 @@
*/
using System.Net;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -71,5 +72,13 @@ namespace ArchiSteamFarm {
return count;
}
internal static string UrlDecode(string message) {
if (string.IsNullOrEmpty(message)) {
return null;
}
return WebUtility.UrlDecode(message);
}
}
}