[confirm] MovieTheMovieDbMatcher: Exception downloading FanArt (1 Viewer)

MJGraf

Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    As reported in another thread by @breese, currently the MovieMetadataExtractor throws a lot of exceptions of the following kind:
    Code:
    [2013-11-03 10:25:12,883] [257174 ] [FanArt Downloader 0] [DEBUG] - MovieTheMovieDbMatcher: Exception downloading FanArt for ID 49948
    System.FormatException: Input string was not in a correct format.
    at Newtonsoft.Json.Utilities.ConvertUtils.Int32Parse(Char[] chars, Int32 start, Int32 length)
    at Newtonsoft.Json.JsonTextReader.ParseNumber()
    at Newtonsoft.Json.JsonTextReader.ParseValue()
    at Newtonsoft.Json.JsonTextReader.ReadInternal()
    at Newtonsoft.Json.JsonReader.ReadAsInt32Internal()
    at Newtonsoft.Json.JsonTextReader.ReadAsInt32()
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, 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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
    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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
    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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
    at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
    at MediaPortal.Extensions.OnlineLibraries.Libraries.MovieDbV3.MovieDbApiV3.GetImages(Int32 id, String language)
    at MediaPortal.Extensions.OnlineLibraries.TheMovieDB.TheMovieDbWrapper.GetMovieFanArt(Int32 id, ImageCollection& imageCollection)
    at MediaPortal.Extensions.OnlineLibraries.MovieTheMovieDbMatcher.DownloadFanArt(Int32 movieDbId)

    I could reproduce this issue. As of this morning, the MovieMetadataExtractor did not work correctly.
    As can be seen from the exception above, the problem arises when the MetadataExtractor tries to download MovieFanArt from TheMovieDB.

    The good news is: We are not alone :D There was an (unplanned) change in the API: http://www.themoviedb.org/talk/5276fb84760ee3603321106e

    FYI: I figured it out. It looks like the height and width for each of the appended images were no longer integers. For example: the response text shows: "height":1080.0 So it was flipping out when it saw the decimal point. I switched them to parse as a double instead of an integer and it now parses them correctly. Thanks!

    The answer from TheMovieDB (from today) was:
    Interesting!
    I should probably coerce them back to integers, but as long as the change you just made will just with that we're good.
    I'll get this fixed up later this afternoon.

    So, breese, could you please check whether it works again and those exceptions are gone now (or maybe tomorrow..)? Thanks

    @morpheus_xx: Changing the height and width properties to "double" as proposed in the linked thread is probably not a good idea because it just doesn't make sense to have fractions of a pixel. But anyway it would be better if our MetadataExtractor would not throw exceptions just because the Json contains "1024.0" instead of "1024" for an integer property. Is there some kind of "please round in such cases" switch in Newtonsoft.Json? Or maybe even a general "if you can't parse one property, please give me at least all the others", because currently for Movies for which the exception is thrown, no data at all is fetched by TheMovieDB.

    Michael
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    65
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    Sorry, still happening... Even reloaded MP2 from scratch...

    [2013-11-04 14:10:48,882] [242594 ] [FanArt Downloader 0] [DEBUG] - MovieTheMovieDbMatcher: Exception downloading FanArt for ID 13761
    System.FormatException: Input string was not in a correct format.
    at Newtonsoft.Json.Utilities.ConvertUtils.Int32Parse(Char[] chars, Int32 start, Int32 length)
    at Newtonsoft.Json.JsonTextReader.ParseNumber()
    at Newtonsoft.Json.JsonTextReader.ParseValue()
    at Newtonsoft.Json.JsonTextReader.ReadInternal()
    at Newtonsoft.Json.JsonReader.ReadAsInt32Internal()
    at Newtonsoft.Json.JsonTextReader.ReadAsInt32()
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, 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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
    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.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
    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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
    at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
    at MediaPortal.Extensions.OnlineLibraries.Libraries.MovieDbV3.MovieDbApiV3.GetImages(Int32 id, String language)
    at MediaPortal.Extensions.OnlineLibraries.TheMovieDB.TheMovieDbWrapper.GetMovieFanArt(Int32 id, ImageCollection& imageCollection)
    at MediaPortal.Extensions.OnlineLibraries.MovieTheMovieDbMatcher.DownloadFanArt(Int32 movieDbId)
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    65
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    deserialisation error, set errorcontext.handled=true and let newtonsoft.json deserialize the rest of the object

    JsonSerializerSettings object with an error handler delegate.

    Thanks!! Now if I only understood any one part of this, I might be a little happyier... On the other side, the Wine I am driking will work... Oh... if there is something specific I can do to help... Just ask...

    BTW: I am happy to help but Monday Night Football is going to start soon... Good Night!!
    (I really wish it was a F1 race!!)
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Just tested again and now it works again. TheTvDB has solved the bug.
    Nevertheless I think we should handle such a situation a bit more gracefully. Will add a jira issue to use an error handler instead of letting the exception go trough...
     

    Users who are viewing this thread

    Top Bottom