Solaire / GLC

Lightweight, console-based, tool which automatically detects installed games and displays them to the user.
GNU General Public License v3.0
16 stars 3 forks source link

Exception in EA Desktop platform (PureOrigin.API) #69

Closed Nutzzz closed 4 months ago

Nutzzz commented 1 year ago

Recently I started seeing this exception:

ERROR: Could not convert string to DateTime: 1977-**-**. Path 'pid.dob', line 9, position 24. | Newtonsoft.Json
   at Newtonsoft.Json.JsonReader.ReadDateTimeString(String s)
   at Newtonsoft.Json.JsonReader.ReadAsDateTime()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject[T]()
   at PureOrigin.API.OriginAPI.GetInternalUser()
   at PureOrigin.API.OriginAPI.LoginAsync()
   at GameLauncher_Console.PlatformEA.GetOwnedGames(String email, SecureString password, String id) | API error for EA owned games.

The exception is in PureOrigin.API, a NuGet package that I added originally to get owned not-installed Origin games, but after #66 was resolved, it's now only used to get the proper game titles for EA Desktop. However, it looks like EA just altered their API slightly so now the user's birthdate shows ** for month and day, and since this is no longer a valid value for a DateTime, PureOrigin.API is hitting an Exception (and yes, I'm 45 years old). It's an easy fix to comment out the birthdate field or change it to a string (and I've done the latter in a fork). Unfortunately, PureOrigin.API was recently archived by its author, so I can't submit a pull request.

Of the various methods of how to proceed from here, I think I'm leaning towards adding PureOrigin.API as a subtree and a dependent project of the solution. I'll make a separate PR [ #70 ].