diff --git a/MediaBrowser.XbmcMetadata/Configuration/NfoOptions.cs b/MediaBrowser.XbmcMetadata/Configuration/NfoOptions.cs
index f631439de..60dcde4db 100644
--- a/MediaBrowser.XbmcMetadata/Configuration/NfoOptions.cs
+++ b/MediaBrowser.XbmcMetadata/Configuration/NfoOptions.cs
@@ -6,6 +6,7 @@ namespace MediaBrowser.XbmcMetadata.Configuration
{
public class ConfigurationFactory : IConfigurationFactory
{
+ ///
public IEnumerable GetConfigurations()
{
return new[]
diff --git a/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj b/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj
index f653270a6..1ca9e43bb 100644
--- a/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj
+++ b/MediaBrowser.XbmcMetadata/MediaBrowser.XbmcMetadata.csproj
@@ -15,4 +15,8 @@
true
+
+ latest
+
+
diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
index 5896497ab..b8d0e6560 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
@@ -22,13 +22,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers
public class BaseNfoParser
where T : BaseItem
{
- ///
- /// The logger
- ///
- protected ILogger Logger { get; private set; }
- protected IProviderManager ProviderManager { get; private set; }
-
- private readonly CultureInfo _usCulture = new CultureInfo("en-US");
private readonly IConfigurationManager _config;
private Dictionary _validProviderIds;
@@ -42,6 +35,19 @@ namespace MediaBrowser.XbmcMetadata.Parsers
ProviderManager = providerManager;
}
+ protected CultureInfo UsCulture { get; } = new CultureInfo("en-US");
+
+ ///
+ /// Gets the logger.
+ ///
+ protected ILogger Logger { get; }
+
+ protected IProviderManager ProviderManager { get; }
+
+ protected virtual bool SupportsUrlAfterClosingXmlTag => false;
+
+ protected virtual string MovieDbParserSearchString => "themoviedb.org/movie/";
+
///
/// Fetches metadata for an item from one xml file
///
@@ -83,8 +89,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers
Fetch(item, metadataFile, GetXmlReaderSettings(), cancellationToken);
}
- protected virtual bool SupportsUrlAfterClosingXmlTag => false;
-
///
/// Fetches the specified item.
///
@@ -198,8 +202,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
- protected virtual string MovieDbParserSearchString => "themoviedb.org/movie/";
-
protected void ParseProviderLinks(T item, string xml)
{
//Look for a match for the Regex pattern "tt" followed by 7 digits
@@ -219,7 +221,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var tmdbId = xml.Substring(index + srch.Length).TrimEnd('/').Split('-')[0];
if (!string.IsNullOrWhiteSpace(tmdbId) && int.TryParse(tmdbId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value))
{
- item.SetProviderId(MetadataProviders.Tmdb, value.ToString(_usCulture));
+ item.SetProviderId(MetadataProviders.Tmdb, value.ToString(UsCulture));
}
}
@@ -234,7 +236,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var tvdbId = xml.Substring(index + srch.Length).TrimEnd('/');
if (!string.IsNullOrWhiteSpace(tvdbId) && int.TryParse(tvdbId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value))
{
- item.SetProviderId(MetadataProviders.Tvdb, value.ToString(_usCulture));
+ item.SetProviderId(MetadataProviders.Tvdb, value.ToString(UsCulture));
}
}
}
@@ -291,7 +293,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!string.IsNullOrEmpty(text))
{
- if (float.TryParse(text, NumberStyles.Any, _usCulture, out var value))
+ if (float.TryParse(text, NumberStyles.Any, UsCulture, out var value))
{
item.CriticRating = value;
}
@@ -417,7 +419,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!string.IsNullOrWhiteSpace(text))
{
- if (int.TryParse(text.Split(' ')[0], NumberStyles.Integer, _usCulture, out var runtime))
+ if (int.TryParse(text.Split(' ')[0], NumberStyles.Integer, UsCulture, out var runtime))
{
item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks;
}
@@ -870,7 +872,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!string.IsNullOrWhiteSpace(val))
{
- if (int.TryParse(val, NumberStyles.Integer, _usCulture, out var intVal))
+ if (int.TryParse(val, NumberStyles.Integer, UsCulture, out var intVal))
{
sortOrder = intVal;
}
diff --git a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs
index 7f4224076..82ac6c548 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
@@ -14,16 +13,12 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{
public class EpisodeNfoParser : BaseNfoParser
{
- public void Fetch(MetadataResult item,
- List images,
- string metadataFile,
- CancellationToken cancellationToken)
+ public EpisodeNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(logger, config, providerManager)
{
- Fetch(item, metadataFile, cancellationToken);
}
- private readonly CultureInfo UsCulture = new CultureInfo("en-US");
-
+ ///
protected override void Fetch(MetadataResult item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken)
{
using (var fileStream = File.OpenRead(metadataFile))
@@ -73,11 +68,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
- ///
- /// Fetches the data from XML node.
- ///
- /// The reader.
- /// The item result.
+ ///
protected override void FetchDataFromXmlNode(XmlReader reader, MetadataResult itemResult)
{
var item = itemResult.Item;
@@ -212,10 +203,5 @@ namespace MediaBrowser.XbmcMetadata.Parsers
break;
}
}
-
- public EpisodeNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
- : base(logger, config, providerManager)
- {
- }
}
}
diff --git a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs
index 0c4de9f33..79d9111fe 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs
@@ -13,13 +13,15 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{
public class MovieNfoParser : BaseNfoParser