Closed darklinkpower closed 6 months ago
Considering that this will affect a lot of people as seen on reddit, if there is no quick solution, as a temporary measure I may suggest using the sku cleaned up for the name.
public List<GameMetadata> GetLibraryGames()
{
var games = new List<GameMetadata>();
var client = new AmazonAccountClient(this);
var entitlements = client.GetAccountEntitlements().GetAwaiter().GetResult();
const string gameSuffix = "_game";
const string gamePreffix = "CDG ";
foreach (var item in entitlements)
{
if (item.product.productLine == "Twitch:FuelEntitlement")
{
continue;
}
var name = item.product.title;
if (name.IsNullOrEmpty())
{
var newName = item.product.sku;
if (newName.EndsWith(gameSuffix))
{
newName = newName.Remove(newName.LastIndexOf(gameSuffix));
}
if (newName.StartsWith(gamePreffix))
{
newName = newName.Substring(gamePreffix.Length -1);
}
name = newName.Replace("_", " ").ToTileCase();
}
var game = new GameMetadata()
{
Source = new MetadataNameProperty("Amazon"),
GameId = item.product.id,
Name = name.RemoveTrademarks(),
Platforms = new HashSet<MetadataProperty> { new MetadataSpecProperty("pc_windows") }
};
games.Add(game);
}
return games;
}
This change makes most names correct and if if coupled with PR https://github.com/JosefNemec/PlayniteExtensions/pull/382, clicking install could help to know the correct name of the games that still have issues.
Not a fan of this workaround. Better check traffic from the plugin to see what new API endpoints they are now using.
I just checked and Amazon has fixed this issue in the response.
Closing issue.
Describe the bug Amazon Games Library imports games without a name. This only affects new installs because older ones will have already imported the games with names correctly.
Some findings:
This issue is caused by the Amazon API used to obtain entitlements items
product.title
not being included in the response of certain games, therefore beingnull
on import. https://github.com/JosefNemec/PlayniteExtensions/blob/cd4ae8f1f7fe53ea6fd983a606ed58895db68929/source/Libraries/AmazonGamesLibrary/AmazonGamesLibrary.cs#L163-L169The affected games are the older ones that use a
Guid
for theirproduct.id
, e.g.e3bc3283-5464-4946-80b8-8ac1401f7b16
,790f3b07-fc9c-4efe-bb66-32bd348a9d23
,fe19ef5f-a1e0-4caf-96b4-590b2c022b15
.Newer titles that have the
amzn1.adg.product
prefix are not affected, e.g.amzn1.adg.product.1e783728-3de2-4114-ae25-2e4dc850d9ff
. Their titles are correctly available in the response.if I'm not wrong, the affected games were the ones given away from the twitch era, before the service was converted to Prime Gaming. This may indicate some conflict on their side that may or may not be resolved.
Updating the current request to updated values doesn't fix it, for example, adding missing parameters in the request or updating the
UserAgent
Considering this, these are the options:
To Reproduce