As reported in another thread by @breese, currently the MovieMetadataExtractor throws a lot of exceptions of the following kind:
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 There was an (unplanned) change in the API: http://www.themoviedb.org/talk/5276fb84760ee3603321106e
The answer from TheMovieDB (from today) was:
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
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 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