Browse Source

Removed Language Parameter in GetPersonList

TMDb API does not publicize an optional language parameter for
person/popular
pull/51/head
Wes Alcock 11 years ago
parent
commit
ccffd4215f
  1. 7
      TMDbLib/Client/TMDbClientPeople.cs
  2. 10
      TMDbLibTests/ClientPersonTests.cs

7
TMDbLib/Client/TMDbClientPeople.cs

@ -93,11 +93,6 @@ namespace TMDbLib.Client
}
public SearchContainer<PersonResult> GetPersonList(PersonListType type, int page = 0)
{
return GetPersonList(type, DefaultLanguage, page);
}
public SearchContainer<PersonResult> GetPersonList(PersonListType type, string language, int page = 0)
{
RestRequest req;
switch (type)
@ -111,8 +106,6 @@ namespace TMDbLib.Client
if (page >= 1)
req.AddParameter("page", page.ToString());
if (language != null)
req.AddParameter("language", language);
req.DateFormat = "yyyy-MM-dd";

10
TMDbLibTests/ClientPersonTests.cs

@ -168,14 +168,14 @@ namespace TMDbLibTests
Assert.IsTrue(listPage2.Results.Count > 0);
Assert.AreEqual(2, listPage2.Page);
SearchContainer<PersonResult> listDe = _config.Client.GetPersonList(type, "de");
SearchContainer<PersonResult> list2 = _config.Client.GetPersonList(type);
Assert.IsNotNull(listDe);
Assert.IsTrue(listDe.Results.Count > 0);
Assert.AreEqual(1, listDe.Page);
Assert.IsNotNull(list2);
Assert.IsTrue(list2.Results.Count > 0);
Assert.AreEqual(1, list2.Page);
// At least one person should differ
Assert.IsTrue(list.Results.Any(s => listDe.Results.Any(x => x.Name != s.Name)));
Assert.IsTrue(list.Results.Any(s => list2.Results.Any(x => x.Name != s.Name)));
}
}
}

Loading…
Cancel
Save