tvdb series provider now considers alias names

pull/702/head
Thomas Gillen 11 years ago
parent b8f642a2d4
commit ef1dcd3423

@ -1109,21 +1109,37 @@ namespace MediaBrowser.Providers.TV
var nodes = doc.SelectNodes("//Series"); var nodes = doc.SelectNodes("//Series");
var comparableName = GetComparableName(name); var comparableName = GetComparableName(name);
if (nodes != null) if (nodes != null)
{
foreach (XmlNode node in nodes) foreach (XmlNode node in nodes)
{ {
var n = node.SelectSingleNode("./SeriesName"); var titles = new List<string>();
if (n != null && string.Equals(GetComparableName(n.InnerText), comparableName, StringComparison.OrdinalIgnoreCase))
var nameNode = node.SelectSingleNode("./SeriesName");
if (nameNode != null)
{
titles.Add(GetComparableName(nameNode.InnerText));
}
var aliasNode = node.SelectSingleNode("./AliasNames");
if (aliasNode != null)
{ {
n = node.SelectSingleNode("./seriesid"); var alias = aliasNode.InnerText.Split('|').Select(GetComparableName);
if (n != null) titles.AddRange(alias);
return n.InnerText;
} }
else
if (titles.Any(t => string.Equals(t, comparableName, StringComparison.OrdinalIgnoreCase)))
{ {
if (n != null) var id = node.SelectSingleNode("./seriesid");
Logger.Info("TVDb Provider - " + n.InnerText + " did not match " + comparableName); if (id != null)
return id.InnerText;
}
foreach (var title in titles)
{
Logger.Info("TVDb Provider - " + title + " did not match " + comparableName);
} }
} }
}
} }
// Try stripping off the year if it was supplied // Try stripping off the year if it was supplied

Loading…
Cancel
Save