|
|
|
@ -15,6 +15,7 @@ using System.Text;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using MediaBrowser.Controller.Entities.TV;
|
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
|
using MediaBrowser.Model.Xml;
|
|
|
|
|
|
|
|
|
@ -227,6 +228,11 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual string MovieDbParserSearchString
|
|
|
|
|
{
|
|
|
|
|
get { return "themoviedb.org/movie/"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ParseProviderLinks(T item, string xml)
|
|
|
|
|
{
|
|
|
|
|
//Look for a match for the Regex pattern "tt" followed by 7 digits
|
|
|
|
@ -238,7 +244,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|
|
|
|
|
|
|
|
|
// Support Tmdb
|
|
|
|
|
// http://www.themoviedb.org/movie/36557
|
|
|
|
|
var srch = "themoviedb.org/movie/";
|
|
|
|
|
var srch = MovieDbParserSearchString;
|
|
|
|
|
var index = xml.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
if (index != -1)
|
|
|
|
@ -250,6 +256,23 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|
|
|
|
item.SetProviderId(MetadataProviders.Tmdb, tmdbId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item is Series)
|
|
|
|
|
{
|
|
|
|
|
srch = "thetvdb.com/?tab=series&id=";
|
|
|
|
|
|
|
|
|
|
index = xml.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
if (index != -1)
|
|
|
|
|
{
|
|
|
|
|
var tvdbId = xml.Substring(index + srch.Length).TrimEnd('/');
|
|
|
|
|
int value;
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(tvdbId) && int.TryParse(tvdbId, NumberStyles.Any, CultureInfo.InvariantCulture, out value))
|
|
|
|
|
{
|
|
|
|
|
item.SetProviderId(MetadataProviders.Tvdb, tvdbId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void FetchDataFromXmlNode(XmlReader reader, MetadataResult<T> itemResult)
|
|
|
|
|