-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Json parser problem with handling null values #3
Comments
Thanks for the report. I'll have a look. |
Note: when reporting things like this, it's always useful to include the MBID (or search terms, for FindXXX) you were using. |
Sorry for that omission.
I can send some mbid examples, but i see that you fixed both issues.
Question, now when a track havn't got length value the api throws an
exception?
We will have to correct the data in MusicBrainz instead?
Thank you.
El mar., 5 may. 2020 a las 15:44, Tim Van Holder (<notifications@github.com>)
escribió:
… Note: when reporting things like this, it's always useful to include the
MBID (or search terms, for FindXXX) you were using.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVXRTXWC7JIPVV5WWXY5UTRQBM7FANCNFSM4MZUNIMQ>
.
|
Now when a track or recording has no length, its For a track it just means that information was not added when the release was added (and shown as ?:?? on the MusicBrainz website). So if that data is needed, it will indeed need to be added to MusicBrainz via the website. |
Hi, in 3.0.0 when Releases have null Status or Recordings have null Length the Find and Look methods quits throwing a Json error.
Follow a stacktrace copy of a Recording with null length.
System.Text.Json.JsonException: Failed to deserialize the 'media' property.
---> System.Text.Json.JsonException: Failed to deserialize the 'tracks' property.
---> System.Text.Json.JsonException: Failed to deserialize the 'recording' property.
---> System.Text.Json.JsonException: Failed to deserialize the 'length' property.
---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
at at System.Text.Json.Utf8JsonReader.TryGetDouble(Double& value)
at at System.Text.Json.Utf8JsonReader.GetDouble()
at at MetaBrainz.MusicBrainz.Json.Readers.RecordingReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options)
--- End of inner exception stack trace ---
at at MetaBrainz.MusicBrainz.Json.Readers.RecordingReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options)
at at MetaBrainz.Common.Json.Converters.ObjectReader
1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at at MetaBrainz.Common.Json.JsonUtils.GetObject[T](Utf8JsonReader& reader, JsonConverter
1 converter, JsonSerializerOptions options)at at MetaBrainz.Common.Json.JsonUtils.GetOptionalObject[T](Utf8JsonReader& reader, JsonConverter
1 converter, JsonSerializerOptions options) at at MetaBrainz.MusicBrainz.Json.Readers.TrackReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options) --- End of inner exception stack trace --- at at MetaBrainz.MusicBrainz.Json.Readers.TrackReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options) at at MetaBrainz.Common.Json.Converters.ObjectReader
1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)at at MetaBrainz.Common.Json.JsonUtils.ReadList[T,TValue](Utf8JsonReader& reader, JsonConverter
1 converter, JsonSerializerOptions options) at at MetaBrainz.Common.Json.JsonUtils.ReadList[T](Utf8JsonReader& reader, JsonConverter
1 converter, JsonSerializerOptions options)at at MetaBrainz.MusicBrainz.Json.Readers.MediumReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options)
--- End of inner exception stack trace ---
at at MetaBrainz.MusicBrainz.Json.Readers.MediumReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options)
at at MetaBrainz.Common.Json.Converters.ObjectReader
1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at at MetaBrainz.Common.Json.JsonUtils.ReadList[T,TValue](Utf8JsonReader& reader, JsonConverter
1 converter, JsonSerializerOptions options)at at MetaBrainz.Common.Json.JsonUtils.ReadList[T](Utf8JsonReader& reader, JsonConverter
1 converter, JsonSerializerOptions options) at at MetaBrainz.MusicBrainz.Json.Readers.ReleaseReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options) --- End of inner exception stack trace --- at at MetaBrainz.MusicBrainz.Json.Readers.ReleaseReader.ReadObjectContents(Utf8JsonReader& reader, JsonSerializerOptions options) at at MetaBrainz.Common.Json.Converters.ObjectReader
1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)at at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
at at System.Text.Json.JsonPropertyInfo.Read(JsonTokenType tokenType, ReadStack& state, Utf8JsonReader& reader)
at at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader)
at at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options)
at at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at at MetaBrainz.Common.Json.JsonUtils.Deserialize[T](String json, JsonSerializerOptions options)
at at MetaBrainz.MusicBrainz.Query.Deserialize[T](String json)
at at MetaBrainz.MusicBrainz.Query.LookupReleaseAsync(Guid mbid, Include inc)
The text was updated successfully, but these errors were encountered: