1
Vote

Allow creation of CatalogTitle from RSS data.

description

In order to be able to merge results from the RSS feeds and the Search API, it would be very useful to be able to convert the RSS item results into CatalogTitle objects.
 
This sort of works but needs to be hardened. I was able to get the ID from parsing the <guid> element from RSS.
 
var movies = from t in xmlFeed.Descendants("item") select GetTitle(t.Element("guid").Value);
 
CatalogTitle GetTitle(string id)
    {
        try
        {
           //Need a delay because linq will call this method faster then api allows.
            System.Threading.Thread.Sleep(300);
            return this.connection.Catalog.GetTitle("http://api.netflix.com/catalog/titles/movies/" + id.Substring(id.LastIndexOf("/") + 1));
        }
        catch(Exception exception)
        {
            return null;
        }
    }

comments