From 12f10fd36a1f41fecae2203aa3328150742d5dec Mon Sep 17 00:00:00 2001 From: nfnty Date: Sun, 5 Jun 2016 21:04:46 +0200 Subject: [PATCH 1/7] Use HTTPS for API requests: FanArt: http:// -> https:// (2) --- MediaBrowser.Providers/Music/FanArtAlbumProvider.cs | 4 +++- MediaBrowser.Providers/Music/FanArtArtistProvider.cs | 4 +++- MediaBrowser.Providers/TV/FanArt/FanArtSeasonProvider.cs | 4 +++- MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs index b47e8df5a..a14c7123a 100644 --- a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using CommonIO; @@ -151,6 +152,7 @@ namespace MediaBrowser.Providers.Music } } + private Regex _regex_http = new Regex("^http://"); private void PopulateImages(List list, List images, ImageType type, @@ -178,7 +180,7 @@ namespace MediaBrowser.Providers.Music Width = width, Height = height, ProviderName = Name, - Url = url, + Url = _regex_http.Replace(url, "https://", 1), Language = i.lang }; diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs index 9b18ac5e9..6afa80507 100644 --- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs +++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs @@ -14,6 +14,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Net; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using CommonIO; @@ -149,6 +150,7 @@ namespace MediaBrowser.Providers.Music PopulateImages(list, obj.musicarts, ImageType.Art, 500, 281); } + private Regex _regex_http = new Regex("^http://"); private void PopulateImages(List list, List images, ImageType type, @@ -176,7 +178,7 @@ namespace MediaBrowser.Providers.Music Width = width, Height = height, ProviderName = Name, - Url = url, + Url = _regex_http.Replace(url, "https://", 1), Language = i.lang }; diff --git a/MediaBrowser.Providers/TV/FanArt/FanArtSeasonProvider.cs b/MediaBrowser.Providers/TV/FanArt/FanArtSeasonProvider.cs index b1930d8f0..e6a47d9d2 100644 --- a/MediaBrowser.Providers/TV/FanArt/FanArtSeasonProvider.cs +++ b/MediaBrowser.Providers/TV/FanArt/FanArtSeasonProvider.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using CommonIO; @@ -160,6 +161,7 @@ namespace MediaBrowser.Providers.TV PopulateImages(list, obj.showbackground, ImageType.Backdrop, 1920, 1080, seasonNumber); } + private Regex _regex_http = new Regex("^http://"); private void PopulateImages(List list, List images, ImageType type, @@ -194,7 +196,7 @@ namespace MediaBrowser.Providers.TV Width = width, Height = height, ProviderName = Name, - Url = url, + Url = _regex_http.Replace(url, "https://", 1), Language = i.lang }; diff --git a/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs b/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs index 5662082db..827a3c50f 100644 --- a/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/FanArt/FanartSeriesProvider.cs @@ -17,6 +17,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Net; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using CommonIO; @@ -162,6 +163,7 @@ namespace MediaBrowser.Providers.TV PopulateImages(list, obj.tvposter, ImageType.Primary, 1000, 1426); } + private Regex _regex_http = new Regex("^http://"); private void PopulateImages(List list, List images, ImageType type, @@ -194,7 +196,7 @@ namespace MediaBrowser.Providers.TV Width = width, Height = height, ProviderName = Name, - Url = url, + Url = _regex_http.Replace(url, "https://", 1), Language = i.lang }; From 874577ed8b6c4b591eeea63c23ed3f4687756a19 Mon Sep 17 00:00:00 2001 From: softworkz Date: Mon, 13 Jun 2016 02:45:15 +0200 Subject: [PATCH 2/7] Channel item sort must not default to name sorting when all sort fields are cleared --- MediaBrowser.Server.Implementations/Channels/ChannelManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index aac5ddcaf..0cdb76345 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -1172,8 +1172,7 @@ namespace MediaBrowser.Server.Implementations.Channels { items = ApplyFilters(items, query.Filters, user); - var sortBy = query.SortBy.Length == 0 ? new[] { ItemSortBy.SortName } : query.SortBy; - items = _libraryManager.Sort(items, user, sortBy, query.SortOrder ?? SortOrder.Ascending); + items = _libraryManager.Sort(items, user, query.SortBy, query.SortOrder ?? SortOrder.Ascending); var all = items.ToList(); var totalCount = totalCountFromProvider ?? all.Count; From 71f8588b3abded917ac4f1ba753bf8a2d60df306 Mon Sep 17 00:00:00 2001 From: softworkz Date: Wed, 22 Jun 2016 23:23:50 +0200 Subject: [PATCH 3/7] ChannelManager: Update Name and CommunityRating values when changed --- .../Channels/ChannelManager.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index aac5ddcaf..41b4eb82c 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -1313,6 +1313,20 @@ namespace MediaBrowser.Server.Implementations.Channels item.Tags = info.Tags; item.HomePageUrl = info.HomePageUrl; } + else + { + if (item.Name != info.Name) + { + item.Name = info.Name; + forceUpdate = true; + } + + if (item.CommunityRating != info.CommunityRating) + { + item.CommunityRating = info.CommunityRating; + forceUpdate = true; + } + } var hasArtists = item as IHasArtist; if (hasArtists != null) From cb9079e0bd611e811d5f6b4be9bc59ffada6addc Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 Jun 2016 12:51:13 -0400 Subject: [PATCH 4/7] continue jquery removal --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 4 ---- .../Persistence/SqliteUserDataRepository.cs | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 51ca2d5ca..a7fc646a9 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -34,7 +34,6 @@ namespace MediaBrowser.Api.UserLibrary /// The _user manager /// private readonly IUserManager _userManager; - private readonly IUserDataManager _userDataRepository; /// /// The _library manager @@ -43,7 +42,6 @@ namespace MediaBrowser.Api.UserLibrary private readonly ILocalizationManager _localization; private readonly IDtoService _dtoService; - private readonly ICollectionManager _collectionManager; /// /// Initializes a new instance of the class. @@ -58,10 +56,8 @@ namespace MediaBrowser.Api.UserLibrary { _userManager = userManager; _libraryManager = libraryManager; - _userDataRepository = userDataRepository; _localization = localization; _dtoService = dtoService; - _collectionManager = collectionManager; } /// diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteUserDataRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteUserDataRepository.cs index 90dbd7770..812e0aa48 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteUserDataRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteUserDataRepository.cs @@ -71,6 +71,8 @@ namespace MediaBrowser.Server.Implementations.Persistence "create unique index if not exists UserDataDb.userdataindex on userdata (key, userId)", "create index if not exists UserDataDb.userdataindex2 on userdata (key, userId, played)", + "create index if not exists UserDataDb.userdataindex3 on userdata (key, userId, playbackPositionTicks)", + "create index if not exists UserDataDb.userdataindex4 on userdata (key, userId, isFavorite)", //pragmas "pragma temp_store = memory", From 38ba821c5051be64c91308baf6def8ffdcbf46dd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 Jun 2016 15:28:55 -0400 Subject: [PATCH 5/7] updated nuget --- Nuget/MediaBrowser.Common.Internal.nuspec | 4 ++-- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 506bc4e36..fd30d23d5 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.651 + 3.0.652 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption. Copyright © Emby 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 07bf6faa7..a8b78b4e3 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.651 + 3.0.652 MediaBrowser.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index c2616798e..105d2c478 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.651 + 3.0.652 Media Browser.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + From 2d3522593e2085eb6ab76a4981e5a93bae2bc837 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 Jun 2016 16:07:35 -0400 Subject: [PATCH 6/7] support nfo episode attributes --- .../Parsers/EpisodeNfoParser.cs | 42 +++++++++++++++++++ .../Savers/EpisodeNfoSaver.cs | 10 +++++ 2 files changed, 52 insertions(+) diff --git a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs index 100ce7af9..6e3114fa1 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs @@ -188,6 +188,48 @@ namespace MediaBrowser.XbmcMetadata.Parsers break; } + case "displayseason": + { + var val = reader.ReadElementContentAsString(); + + if (!string.IsNullOrWhiteSpace(val)) + { + int rval; + + // int.TryParse is local aware, so it can be probamatic, force us culture + if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval)) + { + if ((item.ParentIndexNumber ?? 0) == 0) + { + item.AirsBeforeSeasonNumber = rval; + } + } + } + + break; + } + + case "displayepisode": + { + var val = reader.ReadElementContentAsString(); + + if (!string.IsNullOrWhiteSpace(val)) + { + int rval; + + // int.TryParse is local aware, so it can be probamatic, force us culture + if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval)) + { + if ((item.ParentIndexNumber ?? 0) == 0) + { + item.AirsBeforeEpisodeNumber = rval; + } + } + } + + break; + } + default: base.FetchDataFromXmlNode(reader, itemResult); diff --git a/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs index 60d024072..7523ce6bf 100644 --- a/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs +++ b/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs @@ -72,11 +72,21 @@ namespace MediaBrowser.XbmcMetadata.Savers { writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture)); } + if (episode.AirsBeforeEpisodeNumber.HasValue) + { + writer.WriteElementString("displayepisode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture)); + } if (episode.AirsBeforeSeasonNumber.HasValue) { writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture)); } + var season = episode.AiredSeasonNumber; + if (season.HasValue) + { + writer.WriteElementString("displayseason", season.Value.ToString(UsCulture)); + } + if (episode.DvdEpisodeNumber.HasValue) { writer.WriteElementString("DVD_episodenumber", episode.DvdEpisodeNumber.Value.ToString(UsCulture)); From db5ac92dd276425c9269eb56dbc43eeb7cc5c710 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 Jun 2016 16:07:45 -0400 Subject: [PATCH 7/7] update login --- .../Channels/ChannelManager.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index 8efc600e9..e01468d17 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -1322,17 +1322,18 @@ namespace MediaBrowser.Server.Implementations.Channels } else { - if (item.Name != info.Name) - { - item.Name = info.Name; - forceUpdate = true; - } + // Can't do this right now due to channels that utilize the server's metadata services + //if (item.Name != info.Name) + //{ + // item.Name = info.Name; + // forceUpdate = true; + //} - if (item.CommunityRating != info.CommunityRating) - { - item.CommunityRating = info.CommunityRating; - forceUpdate = true; - } + //if (item.CommunityRating != info.CommunityRating) + //{ + // item.CommunityRating = info.CommunityRating; + // forceUpdate = true; + //} } var hasArtists = item as IHasArtist;