mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
fixes #2559 - URL only movie.nfo does not seem to work at all
This commit is contained in:
parent
f49d20033d
commit
e9ea1d4ce2
@ -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)
|
||||
|
@ -13,6 +13,19 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||
{
|
||||
public class SeriesNfoParser : BaseNfoParser<Series>
|
||||
{
|
||||
protected override bool SupportsUrlAfterClosingXmlTag
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string MovieDbParserSearchString
|
||||
{
|
||||
get { return "themoviedb.org/tv/"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetches the data from XML node.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user