public void TestFind() { var api = new IMDBClient("fr_FR"); var results = api.Find("matrix 2003 "); Assert.Greater(results.Count, 0); var first = results.First(); Assert.That(first.title.ToLower().Contains("matrix")); Assert.AreEqual(2003, first.GetYear()); var detail = api.GetDetails(first.tconst); Assert.AreEqual(first.year, detail.year); Assert.AreEqual(first.title, detail.title); Assert.AreEqual(first.tconst, detail.tconst); }
public static Movie FetchMovie(String file) { var imdb = new IMDBClient(); var f = ParseMovieName(file); if (f.ShouldBeIgnored || f.GuessedTitle.IsNullOrEmpty()) { return(null); } var m = imdb.Find(f.GuessedTitle + " " + f.GuessedYear).FirstOrDefault(); if (m == null) { throw new NoMatchFoundException(); } return(FetchMovie(file, m.tconst, false)); }