diff options
Diffstat (limited to 'MediaBrowser.Controller')
6 files changed, 21 insertions, 27 deletions
diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index 43aef88f1a..0b9972d0a6 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -1,10 +1,9 @@ -using System.IO; -using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.Resolvers; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text.RegularExpressions; -using MediaBrowser.Controller.Resolvers; namespace MediaBrowser.Controller.Library { @@ -16,7 +15,7 @@ namespace MediaBrowser.Controller.Library /// <summary> /// The TVDB API key /// </summary> - public static readonly string TVDBApiKey = "B89CE93890E9419B"; + public static readonly string TvdbApiKey = "B89CE93890E9419B"; /// <summary> /// The banner URL /// </summary> @@ -93,7 +92,7 @@ namespace MediaBrowser.Controller.Library // Look for one of the season folder names foreach (var name in SeasonFolderNames) { - int index = path.IndexOf(name, StringComparison.OrdinalIgnoreCase); + var index = path.IndexOf(name, StringComparison.OrdinalIgnoreCase); if (index != -1) { @@ -115,7 +114,7 @@ namespace MediaBrowser.Controller.Library int length = 0; // Find out where the numbers start, and then keep going until they end - for (int i = 0; i < path.Length; i++) + for (var i = 0; i < path.Length; i++) { if (char.IsNumber(path, i)) { diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs index 15a9b08f05..8f55d5b47c 100644 --- a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs +++ b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeVideoInfoProvider.cs @@ -286,7 +286,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo /// <summary> /// The dummy chapter duration /// </summary> - private readonly long DummyChapterDuration = TimeSpan.FromMinutes(10).Ticks; + private readonly long _dummyChapterDuration = TimeSpan.FromMinutes(5).Ticks; /// <summary> /// Adds the dummy chapters. @@ -296,7 +296,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo { var runtime = video.RunTimeTicks ?? 0; - if (runtime < DummyChapterDuration) + if (runtime < _dummyChapterDuration) { return; } @@ -315,7 +315,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo }); index++; - currentChapterTicks += DummyChapterDuration; + currentChapterTicks += _dummyChapterDuration; } video.Chapters = chapters; diff --git a/MediaBrowser.Controller/Providers/Music/LastfmHelper.cs b/MediaBrowser.Controller/Providers/Music/LastfmHelper.cs index 72e3a3a6e8..8e335ba859 100644 --- a/MediaBrowser.Controller/Providers/Music/LastfmHelper.cs +++ b/MediaBrowser.Controller/Providers/Music/LastfmHelper.cs @@ -2,6 +2,7 @@ using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Model.Entities; using System; +using System.Linq; namespace MediaBrowser.Controller.Providers.Music { @@ -30,7 +31,7 @@ namespace MediaBrowser.Controller.Providers.Music artist.ProductionYear = yearFormed; if (data.tags != null) { - AddGenres(artist, data.tags); + AddTags(artist, data.tags); } var entity = artist as Artist; @@ -55,21 +56,15 @@ namespace MediaBrowser.Controller.Providers.Music item.ProductionYear = release.Year; if (data.toptags != null) { - AddGenres(item, data.toptags); + AddTags(item, data.toptags); } } - private static void AddGenres(BaseItem item, LastfmTags tags) + private static void AddTags(BaseItem item, LastfmTags tags) { - item.Genres.Clear(); + var itemTags = (from tag in tags.tag where !string.IsNullOrEmpty(tag.name) select tag.name).ToList(); - foreach (var tag in tags.tag) - { - if (!string.IsNullOrEmpty(tag.name)) - { - item.AddGenre(tag.name); - } - } + item.Tags = itemTags; } } } diff --git a/MediaBrowser.Controller/Providers/TV/RemoteEpisodeProvider.cs b/MediaBrowser.Controller/Providers/TV/RemoteEpisodeProvider.cs index f4ba98f70f..2b4173ed90 100644 --- a/MediaBrowser.Controller/Providers/TV/RemoteEpisodeProvider.cs +++ b/MediaBrowser.Controller/Providers/TV/RemoteEpisodeProvider.cs @@ -179,7 +179,7 @@ namespace MediaBrowser.Controller.Providers.TV seasonNumber = "0"; // Specials } - var url = string.Format(episodeQuery, TVUtils.TVDBApiKey, seriesId, seasonNumber, episodeNumber, ConfigurationManager.Configuration.PreferredMetadataLanguage); + var url = string.Format(episodeQuery, TVUtils.TvdbApiKey, seriesId, seasonNumber, episodeNumber, ConfigurationManager.Configuration.PreferredMetadataLanguage); var doc = new XmlDocument(); try @@ -205,7 +205,7 @@ namespace MediaBrowser.Controller.Providers.TV //this is basicly just for anime. if (!doc.HasChildNodes && Int32.Parse(seasonNumber) == 1) { - url = string.Format(absEpisodeQuery, TVUtils.TVDBApiKey, seriesId, episodeNumber, ConfigurationManager.Configuration.PreferredMetadataLanguage); + url = string.Format(absEpisodeQuery, TVUtils.TvdbApiKey, seriesId, episodeNumber, ConfigurationManager.Configuration.PreferredMetadataLanguage); try { @@ -250,7 +250,7 @@ namespace MediaBrowser.Controller.Providers.TV if (episode.IndexNumber < 0) episode.IndexNumber = doc.SafeGetInt32("//EpisodeNumber"); - episode.Name = episode.IndexNumber.Value.ToString("000") + " - " + doc.SafeGetString("//EpisodeName"); + episode.Name = doc.SafeGetString("//EpisodeName"); episode.CommunityRating = doc.SafeGetSingle("//Rating", -1, 10); var firstAired = doc.SafeGetString("//FirstAired"); DateTime airDate; diff --git a/MediaBrowser.Controller/Providers/TV/RemoteSeasonProvider.cs b/MediaBrowser.Controller/Providers/TV/RemoteSeasonProvider.cs index 79ea75f8ec..70ac2d45ca 100644 --- a/MediaBrowser.Controller/Providers/TV/RemoteSeasonProvider.cs +++ b/MediaBrowser.Controller/Providers/TV/RemoteSeasonProvider.cs @@ -158,7 +158,7 @@ namespace MediaBrowser.Controller.Providers.TV if ((season.PrimaryImagePath == null) || (!season.HasImage(ImageType.Banner)) || (season.BackdropImagePaths == null)) { var images = new XmlDocument(); - var url = string.Format("http://www.thetvdb.com/api/" + TVUtils.TVDBApiKey + "/series/{0}/banners.xml", seriesId); + var url = string.Format("http://www.thetvdb.com/api/" + TVUtils.TvdbApiKey + "/series/{0}/banners.xml", seriesId); using (var imgs = await HttpClient.Get(new HttpRequestOptions { diff --git a/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs b/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs index 9dd5aa4189..eb689ed2f7 100644 --- a/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs +++ b/MediaBrowser.Controller/Providers/TV/RemoteSeriesProvider.cs @@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.Providers.TV if (!string.IsNullOrEmpty(seriesId)) { - string url = string.Format(seriesGet, TVUtils.TVDBApiKey, seriesId, ConfigurationManager.Configuration.PreferredMetadataLanguage); + string url = string.Format(seriesGet, TVUtils.TvdbApiKey, seriesId, ConfigurationManager.Configuration.PreferredMetadataLanguage); var doc = new XmlDocument(); try @@ -296,7 +296,7 @@ namespace MediaBrowser.Controller.Providers.TV /// <returns>Task.</returns> private async Task FetchActors(Series series, string seriesId, XmlDocument doc, CancellationToken cancellationToken) { - string urlActors = string.Format(getActors, TVUtils.TVDBApiKey, seriesId); + string urlActors = string.Format(getActors, TVUtils.TvdbApiKey, seriesId); var docActors = new XmlDocument(); try @@ -377,7 +377,7 @@ namespace MediaBrowser.Controller.Providers.TV { if ((!string.IsNullOrEmpty(seriesId)) && ((series.PrimaryImagePath == null) || (series.BackdropImagePaths == null))) { - string url = string.Format("http://www.thetvdb.com/api/" + TVUtils.TVDBApiKey + "/series/{0}/banners.xml", seriesId); + string url = string.Format("http://www.thetvdb.com/api/" + TVUtils.TvdbApiKey + "/series/{0}/banners.xml", seriesId); var images = new XmlDocument(); try |
