diff --git a/MediaBrowser.Providers/Plugins/Omdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Omdb/Configuration/PluginConfiguration.cs
new file mode 100644
index 0000000000..a9eecdd9ee
--- /dev/null
+++ b/MediaBrowser.Providers/Plugins/Omdb/Configuration/PluginConfiguration.cs
@@ -0,0 +1,9 @@
+using MediaBrowser.Model.Plugins;
+
+namespace MediaBrowser.Providers.Plugins.Omdb
+{
+ public class PluginConfiguration : BasePluginConfiguration
+ {
+ public bool CastAndCrew { get; set; }
+ }
+}
diff --git a/MediaBrowser.Providers/Plugins/Omdb/Configuration/config.html b/MediaBrowser.Providers/Plugins/Omdb/Configuration/config.html
new file mode 100644
index 0000000000..8b117ec8d2
--- /dev/null
+++ b/MediaBrowser.Providers/Plugins/Omdb/Configuration/config.html
@@ -0,0 +1,49 @@
+
+
+
+ OMDb
+
+
+
+
+
diff --git a/MediaBrowser.Providers/Plugins/Omdb/OmdbImageProvider.cs b/MediaBrowser.Providers/Plugins/Omdb/OmdbImageProvider.cs
index a450c2a6db..3cf4c3d503 100644
--- a/MediaBrowser.Providers/Plugins/Omdb/OmdbImageProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Omdb/OmdbImageProvider.cs
@@ -92,6 +92,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
{
return item is Movie || item is Trailer || item is Episode;
}
+
// After other internet providers, because they're better
// But before fallback providers like screengrab
public int Order => 90;
diff --git a/MediaBrowser.Providers/Plugins/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Plugins/Omdb/OmdbItemProvider.cs
index 64a75955a2..35a840f00b 100644
--- a/MediaBrowser.Providers/Plugins/Omdb/OmdbItemProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Omdb/OmdbItemProvider.cs
@@ -103,6 +103,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
{
urlQuery += "&t=" + WebUtility.UrlEncode(name);
}
+
urlQuery += "&type=" + type;
}
else
@@ -117,6 +118,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
{
urlQuery += string.Format(CultureInfo.InvariantCulture, "&Episode={0}", searchInfo.IndexNumber);
}
+
if (searchInfo.ParentIndexNumber.HasValue)
{
urlQuery += string.Format(CultureInfo.InvariantCulture, "&Season={0}", searchInfo.ParentIndexNumber);
diff --git a/MediaBrowser.Providers/Plugins/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Plugins/Omdb/OmdbProvider.cs
index fbdd293edf..dcc003dca9 100644
--- a/MediaBrowser.Providers/Plugins/Omdb/OmdbProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Omdb/OmdbProvider.cs
@@ -87,10 +87,10 @@ namespace MediaBrowser.Providers.Plugins.Omdb
item.CommunityRating = imdbRating;
}
- //if (!string.IsNullOrEmpty(result.Website))
- //{
- // item.HomePageUrl = result.Website;
- //}
+ if (!string.IsNullOrEmpty(result.Website))
+ {
+ item.HomePageUrl = result.Website;
+ }
if (!string.IsNullOrWhiteSpace(result.imdbID))
{
@@ -121,7 +121,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
if (!string.IsNullOrWhiteSpace(episodeImdbId))
{
- foreach (var episode in (seasonResult.Episodes ?? new RootObject[] { }))
+ foreach (var episode in seasonResult.Episodes)
{
if (string.Equals(episodeImdbId, episode.imdbID, StringComparison.OrdinalIgnoreCase))
{
@@ -134,7 +134,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
// finally, search by numbers
if (result == null)
{
- foreach (var episode in (seasonResult.Episodes ?? new RootObject[] { }))
+ foreach (var episode in seasonResult.Episodes)
{
if (episode.Episode == episodeNumber)
{
@@ -188,10 +188,10 @@ namespace MediaBrowser.Providers.Plugins.Omdb
item.CommunityRating = imdbRating;
}
- //if (!string.IsNullOrEmpty(result.Website))
- //{
- // item.HomePageUrl = result.Website;
- //}
+ if (!string.IsNullOrEmpty(result.Website))
+ {
+ item.HomePageUrl = result.Website;
+ }
if (!string.IsNullOrWhiteSpace(result.imdbID))
{
@@ -263,6 +263,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
{
return url;
}
+
return url + "&" + query;
}
@@ -386,7 +387,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
var isConfiguredForEnglish = IsConfiguredForEnglish(item) || _configurationManager.Configuration.EnableNewOmdbSupport;
- // Grab series genres because imdb data is better than tvdb. Leave movies alone
+ // Grab series genres because IMDb data is better than TVDB. Leave movies alone
// But only do it if english is the preferred language because this data will not be localized
if (isConfiguredForEnglish && !string.IsNullOrWhiteSpace(result.Genre))
{
@@ -407,45 +408,50 @@ namespace MediaBrowser.Providers.Plugins.Omdb
item.Overview = result.Plot;
}
- //if (!string.IsNullOrWhiteSpace(result.Director))
- //{
- // var person = new PersonInfo
- // {
- // Name = result.Director.Trim(),
- // Type = PersonType.Director
- // };
-
- // itemResult.AddPerson(person);
- //}
-
- //if (!string.IsNullOrWhiteSpace(result.Writer))
- //{
- // var person = new PersonInfo
- // {
- // Name = result.Director.Trim(),
- // Type = PersonType.Writer
- // };
-
- // itemResult.AddPerson(person);
- //}
-
- //if (!string.IsNullOrWhiteSpace(result.Actors))
- //{
- // var actorList = result.Actors.Split(',');
- // foreach (var actor in actorList)
- // {
- // if (!string.IsNullOrWhiteSpace(actor))
- // {
- // var person = new PersonInfo
- // {
- // Name = actor.Trim(),
- // Type = PersonType.Actor
- // };
-
- // itemResult.AddPerson(person);
- // }
- // }
- //}
+ if (!Plugin.Instance.Configuration.CastAndCrew)
+ {
+ return;
+ }
+
+ if (!string.IsNullOrWhiteSpace(result.Director))
+ {
+ var person = new PersonInfo
+ {
+ Name = result.Director.Trim(),
+ Type = PersonType.Director
+ };
+
+ itemResult.AddPerson(person);
+ }
+
+ if (!string.IsNullOrWhiteSpace(result.Writer))
+ {
+ var person = new PersonInfo
+ {
+ Name = result.Director.Trim(),
+ Type = PersonType.Writer
+ };
+
+ itemResult.AddPerson(person);
+ }
+
+ if (!string.IsNullOrWhiteSpace(result.Actors))
+ {
+ var actorList = result.Actors.Split(',');
+ foreach (var actor in actorList)
+ {
+ if (!string.IsNullOrWhiteSpace(actor))
+ {
+ var person = new PersonInfo
+ {
+ Name = actor.Trim(),
+ Type = PersonType.Actor
+ };
+
+ itemResult.AddPerson(person);
+ }
+ }
+ }
}
private bool IsConfiguredForEnglish(BaseItem item)
@@ -459,40 +465,70 @@ namespace MediaBrowser.Providers.Plugins.Omdb
internal class SeasonRootObject
{
public string Title { get; set; }
+
public string seriesID { get; set; }
+
public int Season { get; set; }
+
public int? totalSeasons { get; set; }
+
public RootObject[] Episodes { get; set; }
+
public string Response { get; set; }
}
internal class RootObject
{
public string Title { get; set; }
+
public string Year { get; set; }
+
public string Rated { get; set; }
+
public string Released { get; set; }
+
public string Runtime { get; set; }
+
public string Genre { get; set; }
+
public string Director { get; set; }
+
public string Writer { get; set; }
+
public string Actors { get; set; }
+
public string Plot { get; set; }
+
public string Language { get; set; }
+
public string Country { get; set; }
+
public string Awards { get; set; }
+
public string Poster { get; set; }
+
public List Ratings { get; set; }
+
public string Metascore { get; set; }
+
public string imdbRating { get; set; }
+
public string imdbVotes { get; set; }
+
public string imdbID { get; set; }
+
public string Type { get; set; }
+
public string DVD { get; set; }
+
public string BoxOffice { get; set; }
+
public string Production { get; set; }
+
public string Website { get; set; }
+
public string Response { get; set; }
+
public int Episode { get; set; }
public float? GetRottenTomatoScore()
@@ -509,12 +545,15 @@ namespace MediaBrowser.Providers.Plugins.Omdb
}
}
}
+
return null;
}
}
+
public class OmdbRating
{
public string Source { get; set; }
+
public string Value { get; set; }
}
}
diff --git a/MediaBrowser.Providers/Plugins/Omdb/Plugin.cs b/MediaBrowser.Providers/Plugins/Omdb/Plugin.cs
new file mode 100644
index 0000000000..6ce2333e00
--- /dev/null
+++ b/MediaBrowser.Providers/Plugins/Omdb/Plugin.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Model.Plugins;
+using MediaBrowser.Model.Serialization;
+
+namespace MediaBrowser.Providers.Plugins.Omdb
+{
+ public class Plugin : BasePlugin, IHasWebPages
+ {
+ public static Plugin Instance { get; private set; }
+
+ public override Guid Id => new Guid("a628c0da-fac5-4c7e-9d1a-7134223f14c8");
+
+ public override string Name => "OMDb";
+
+ public override string Description => "Get metadata for movies and other video content from OMDb.";
+
+ public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
+ : base(applicationPaths, xmlSerializer)
+ {
+ Instance = this;
+ }
+
+ public IEnumerable GetPages()
+ {
+ yield return new PluginPageInfo
+ {
+ Name = Name,
+ EmbeddedResourcePath = GetType().Namespace + ".Configuration.config.html"
+ };
+ }
+ }
+}
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/TheTvdb/Configuration/PluginConfiguration.cs
new file mode 100644
index 0000000000..0a73634dc8
--- /dev/null
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/Configuration/PluginConfiguration.cs
@@ -0,0 +1,8 @@
+using MediaBrowser.Model.Plugins;
+
+namespace MediaBrowser.Providers.Plugins.TheTvdb
+{
+ public class PluginConfiguration : BasePluginConfiguration
+ {
+ }
+}
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/Plugin.cs b/MediaBrowser.Providers/Plugins/TheTvdb/Plugin.cs
new file mode 100644
index 0000000000..2e6f548cac
--- /dev/null
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/Plugin.cs
@@ -0,0 +1,24 @@
+using System;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Model.Serialization;
+
+namespace MediaBrowser.Providers.Plugins.TheTvdb
+{
+ public class Plugin : BasePlugin
+ {
+ public static Plugin Instance { get; private set; }
+
+ public override Guid Id => new Guid("a677c0da-fac5-4cde-941a-7134223f14c8");
+
+ public override string Name => "TheTVDB";
+
+ public override string Description => "Get metadata for movies and other video content from TheTVDB.";
+
+ public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
+ : base(applicationPaths, xmlSerializer)
+ {
+ Instance = this;
+ }
+ }
+}
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbClientManager.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbClientManager.cs
index b73834155c..24d60deb91 100644
--- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbClientManager.cs
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbClientManager.cs
@@ -120,6 +120,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
var cacheKey = GenerateKey("series", zap2ItId, language);
return TryGetValue(cacheKey, language, () => TvDbClient.Search.SearchSeriesByZap2ItIdAsync(zap2ItId, cancellationToken));
}
+
public Task> GetActorsAsync(
int tvdbId,
string language,
@@ -190,7 +191,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
episodeQuery.AbsoluteNumber = searchInfo.IndexNumber.Value;
break;
default:
- //aired order
+ // aired order
episodeQuery.AiredEpisode = searchInfo.IndexNumber.Value;
episodeQuery.AiredSeason = searchInfo.ParentIndexNumber.Value;
break;
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs
index 08c2a74d2c..5a4827d2fd 100644
--- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbEpisodeProvider.cs
@@ -14,9 +14,8 @@ using TvDbSharper.Dto;
namespace MediaBrowser.Providers.Plugins.TheTvdb
{
-
///
- /// Class RemoteEpisodeProvider
+ /// Class RemoteEpisodeProvider.
///
public class TvdbEpisodeProvider : IRemoteMetadataProvider, IHasOrder
{
@@ -139,7 +138,6 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
Name = episode.EpisodeName,
Overview = episode.Overview,
CommunityRating = (float?)episode.SiteRating,
-
}
};
result.ResetPeople();
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbPersonImageProvider.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbPersonImageProvider.cs
index c1cdc90e90..77425f1d2b 100644
--- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbPersonImageProvider.cs
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbPersonImageProvider.cs
@@ -57,7 +57,6 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
{
EnableImages = false
}
-
}).Cast()
.Where(i => TvdbSeriesProvider.IsValidSeries(i.ProviderIds))
.ToList();
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeasonImageProvider.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeasonImageProvider.cs
index a5d183df77..7abcd29ec6 100644
--- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeasonImageProvider.cs
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeasonImageProvider.cs
@@ -55,7 +55,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
if (series == null || !season.IndexNumber.HasValue || !TvdbSeriesProvider.IsValidSeries(series.ProviderIds))
{
- return new RemoteImageInfo[] { };
+ return Array.Empty();
}
var tvdbId = Convert.ToInt32(series.GetProviderId(MetadataProviders.Tvdb));
@@ -113,8 +113,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
imageInfo.Type = TvdbUtils.GetImageTypeFromKeyType(image.KeyType);
list.Add(imageInfo);
}
- var isLanguageEn = string.Equals(preferredLanguage, "en", StringComparison.OrdinalIgnoreCase);
+ var isLanguageEn = string.Equals(preferredLanguage, "en", StringComparison.OrdinalIgnoreCase);
return list.OrderByDescending(i =>
{
if (string.Equals(preferredLanguage, i.Language, StringComparison.OrdinalIgnoreCase))
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesImageProvider.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesImageProvider.cs
index 1bad607565..f65707291b 100644
--- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesImageProvider.cs
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesImageProvider.cs
@@ -79,6 +79,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
tvdbId);
}
}
+
return remoteImages;
}
@@ -110,8 +111,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
imageInfo.Type = TvdbUtils.GetImageTypeFromKeyType(image.KeyType);
list.Add(imageInfo);
}
- var isLanguageEn = string.Equals(preferredLanguage, "en", StringComparison.OrdinalIgnoreCase);
+ var isLanguageEn = string.Equals(preferredLanguage, "en", StringComparison.OrdinalIgnoreCase);
return list.OrderByDescending(i =>
{
if (string.Equals(preferredLanguage, i.Language, StringComparison.OrdinalIgnoreCase))
diff --git a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesProvider.cs b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesProvider.cs
index f6cd249f51..d4fcad6437 100644
--- a/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesProvider.cs
+++ b/MediaBrowser.Providers/Plugins/TheTvdb/TvdbSeriesProvider.cs
@@ -22,6 +22,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
public class TvdbSeriesProvider : IRemoteMetadataProvider, IHasOrder
{
internal static TvdbSeriesProvider Current { get; private set; }
+
private readonly IHttpClient _httpClient;
private readonly ILogger _logger;
private readonly ILibraryManager _libraryManager;
@@ -145,7 +146,6 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
private async Task GetSeriesByRemoteId(string id, string idType, string language, CancellationToken cancellationToken)
{
-
TvDbResponse result = null;
try
@@ -249,6 +249,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
ImageUrl = TvdbUtils.BannerUrl + seriesSearchResult.Banner
};
+
try
{
var seriesSesult =
@@ -274,11 +275,12 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
}
///
- /// The remove
+ /// The remove.
///
const string remove = "\"'!`?";
+
///
- /// The spacers
+ /// The spacers.
///
const string spacers = "/,.:;\\(){}[]+-_=–*"; // (there are two types of dashes, short and long)
@@ -315,8 +317,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
sb.Append(c);
}
}
- sb.Replace(", the", string.Empty).Replace("the ", " ").Replace(" the ", " ");
+ sb.Replace(", the", string.Empty).Replace("the ", " ").Replace(" the ", " ");
return Regex.Replace(sb.ToString().Trim(), @"\s+", " ");
}