Update ...

Dec 4, 2010 at 10:52 PM

Hi,

 

The tmdb api has changed. In some cases no value is provided for the score property of movies. The current version of this API throws an exception:

There is an error in XML document (8, 8).

I've been able to get around this by making a nullable property in the TmdbMovie class.

[XmlElement("score")]
private decimal? _score { get; set; }
public decimal Score
{
    get
    {
        if (this._score.HasValue)
            return this._score.Value;

        return 0;
    }
}}

I'm not sure if the field is simply broken and if Tmdb will fix it, so for now I consider this a temporary workaround.

Thanks for your work on the API!

Dec 23, 2010 at 6:42 AM

Correction: 

 Better to return no score indicating it was not scored than a 0 score.

[XmlElement("score")]
public string Score
{
   get { return score.HasValue ? score.Value.ToString() : ""; }
   set
   {
      decimal d;
      if (decimal.TryParse(value, out d))
         score = d;
      else
         score = null;
   }
}

private decimal? score;

also, "translated" can also be nullable so the same pattern should be applied.

 

 

 

 

Mar 9, 2011 at 9:55 AM

You might be receiving another XML error when it hits the image elements.

Looks as though tmdb have added more sizes which the enum doesn't specify.

Workaround is to add w342, w154 and w1280 (there may be more) as sizes to the enum.

TmdbImageSize.cs

public enum TmdbImageSize
    {
        original,
        cover,
        mid,
        thumb,
        poster,
        profile,
        w342,
        w154,
        w1280
    }

 

Apr 7, 2011 at 11:06 PM

Thanks! I needed that .. :)

 It's time the project owner creates a new release. :)