diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 6bf58455f..ae988f938 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1058,18 +1058,8 @@ namespace Emby.Server.Implementations.Dto dto.CommunityRating = item.CommunityRating; } - //if (item.IsFolder) - //{ - // var folder = (Folder)item; - - // if (fields.Contains(ItemFields.IndexOptions)) - // { - // dto.IndexOptions = folder.IndexByOptionStrings.ToArray(); - // } - //} - var supportsPlaceHolders = item as ISupportsPlaceHolders; - if (supportsPlaceHolders != null) + if (supportsPlaceHolders != null && supportsPlaceHolders.IsPlaceHolder) { dto.IsPlaceHolder = supportsPlaceHolders.IsPlaceHolder; } diff --git a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs index bba625cd1..97197a0ab 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs @@ -174,7 +174,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings var imagesWithText = allImages.Where(i => string.Equals(i.text, "yes", StringComparison.OrdinalIgnoreCase)).ToList(); var imagesWithoutText = allImages.Where(i => string.Equals(i.text, "no", StringComparison.OrdinalIgnoreCase)).ToList(); - double desiredAspect = IsMovie(programEntry) ? 0.666666667 : wideAspect; + double desiredAspect = 0.666666667; programEntry.primaryImage = GetProgramImage(ApiUrl, imagesWithText, true, desiredAspect) ?? GetProgramImage(ApiUrl, allImages, true, desiredAspect); diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs index 4ad411c19..1a5e6bddd 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs @@ -742,7 +742,7 @@ namespace Emby.Server.Implementations.LiveTv else { // Increment this whenver some internal change deems it necessary - var etag = info.Etag + "4"; + var etag = info.Etag + "5"; if (!string.Equals(etag, item.ExternalEtag, StringComparison.OrdinalIgnoreCase)) { @@ -1422,13 +1422,16 @@ namespace Emby.Server.Implementations.LiveTv await _libraryManager.UpdateItem(program, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false); } - foreach (var program in newPrograms) + if (!(service is EmbyTV.EmbyTV)) { - _providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low); - } - foreach (var program in updatedPrograms) - { - _providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low); + foreach (var program in newPrograms) + { + _providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low); + } + foreach (var program in updatedPrograms) + { + _providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low); + } } currentChannel.IsMovie = isMovie; diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index a5582ddc5..6bfa90498 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -1671,7 +1671,6 @@ namespace Emby.Server.Implementations.Session dtoOptions.Fields.Remove(ItemFields.DisplayPreferencesId); dtoOptions.Fields.Remove(ItemFields.Etag); dtoOptions.Fields.Remove(ItemFields.ExternalEtag); - dtoOptions.Fields.Remove(ItemFields.IndexOptions); dtoOptions.Fields.Remove(ItemFields.InheritedParentalRatingValue); dtoOptions.Fields.Remove(ItemFields.ItemCounts); dtoOptions.Fields.Remove(ItemFields.Keywords); diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 48c9b83aa..727b7dbeb 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -211,33 +211,6 @@ namespace MediaBrowser.Controller.Entities item.SetParent(null); } - /// - /// Returns the valid set of index by options for this folder type. - /// Override or extend to modify. - /// - /// Dictionary{System.StringFunc{UserIEnumerable{BaseItem}}}. - protected virtual IEnumerable GetIndexByOptions() - { - return new List { - {"None"}, - {"Performer"}, - {"Genre"}, - {"Director"}, - {"Year"}, - {"Studio"} - }; - } - - /// - /// Get the list of indexy by choices for this folder (localized). - /// - /// The index by option strings. - [IgnoreDataMember] - public IEnumerable IndexByOptionStrings - { - get { return GetIndexByOptions(); } - } - /// /// Gets the actual children. /// diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 17494eb08..b681fdcb1 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -66,17 +66,6 @@ namespace MediaBrowser.Controller.Entities.TV return series == null ? SeriesName : series.SortName; } - // Genre, Rating and Stuido will all be the same - protected override IEnumerable GetIndexByOptions() - { - return new List { - {"None"}, - {"Performer"}, - {"Director"}, - {"Year"}, - }; - } - public override List GetUserDataKeys() { var list = base.GetUserDataKeys(); diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index c54f93f11..0b9662450 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -227,17 +227,6 @@ namespace MediaBrowser.Controller.Entities.TV return list; } - // Studio, Genre and Rating will all be the same so makes no sense to index by these - protected override IEnumerable GetIndexByOptions() - { - return new List { - {"None"}, - {"Performer"}, - {"Director"}, - {"Year"}, - }; - } - [IgnoreDataMember] public bool ContainsEpisodesWithoutSeasonFolders { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 665640dfd..87fc58130 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -57,8 +57,13 @@ namespace MediaBrowser.Controller.LiveTv return value; } + else + { + double value = 2; + value /= 3; - return null; + return value; + } } [IgnoreDataMember] diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index c348ffda7..c14b1f416 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -42,6 +42,11 @@ namespace MediaBrowser.Controller.MediaEncoding { var hwType = encodingOptions.HardwareAccelerationType; + if (!encodingOptions.EnableHardwareEncoding) + { + hwType = null; + } + if (string.Equals(hwType, "qsv", StringComparison.OrdinalIgnoreCase) || string.Equals(hwType, "h264_qsv", StringComparison.OrdinalIgnoreCase)) { @@ -1761,14 +1766,11 @@ namespace MediaBrowser.Controller.MediaEncoding return null; } - if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec)) + if (state.VideoStream != null && + !string.IsNullOrWhiteSpace(state.VideoStream.Codec) && + !string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) && + encodingOptions.EnableHardwareDecoding) { - if (!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType)) - { - // causing unpredictable results - //return "-hwaccel auto"; - } - if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase)) { switch (state.MediaSource.VideoStream.Codec.ToLower()) @@ -1818,6 +1820,13 @@ namespace MediaBrowser.Controller.MediaEncoding return "-c:v h264_cuvid "; } break; + case "hevc": + case "h265": + if (_mediaEncoder.SupportsDecoder("hevc_cuvid")) + { + return "-c:v hevc_cuvid "; + } + break; } } } diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 43e463902..338f58c16 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -91,7 +91,8 @@ namespace MediaBrowser.MediaEncoding.Encoder "hevc_qsv", "mpeg2_qsv", "vc1_qsv", - "h264_cuvid" + "h264_cuvid", + "hevc_cuvid" }; foreach (var codec in required) diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs index 9a0b2d35b..e1b0514e7 100644 --- a/MediaBrowser.Model/Configuration/EncodingOptions.cs +++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs @@ -13,6 +13,8 @@ namespace MediaBrowser.Model.Configuration public string VaapiDevice { get; set; } public int H264Crf { get; set; } public string H264Preset { get; set; } + public bool EnableHardwareDecoding { get; set; } + public bool EnableHardwareEncoding { get; set; } public EncodingOptions() { @@ -22,6 +24,8 @@ namespace MediaBrowser.Model.Configuration EncodingThreadCount = -1; VaapiDevice = "/dev/dri/card0"; H264Crf = 23; + EnableHardwareDecoding = true; + EnableHardwareEncoding = true; } } } diff --git a/MediaBrowser.Model/Querying/ItemFields.cs b/MediaBrowser.Model/Querying/ItemFields.cs index 85d0a0baf..5873293f7 100644 --- a/MediaBrowser.Model/Querying/ItemFields.cs +++ b/MediaBrowser.Model/Querying/ItemFields.cs @@ -87,11 +87,6 @@ /// HomePageUrl, - /// - /// The fields that the server supports indexing on - /// - IndexOptions, - /// /// The item counts /// diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj index d16ae9161..65791ed10 100644 --- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj +++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj @@ -72,7 +72,6 @@ - diff --git a/MediaBrowser.Providers/Movies/LiveTvMovieDbProvider.cs b/MediaBrowser.Providers/Movies/LiveTvMovieDbProvider.cs deleted file mode 100644 index a2d35b500..000000000 --- a/MediaBrowser.Providers/Movies/LiveTvMovieDbProvider.cs +++ /dev/null @@ -1,38 +0,0 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.LiveTv; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Providers; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.Providers.Movies -{ - public class LiveTvMovieDbProvider : IRemoteMetadataProvider, IHasOrder - { - public Task> GetSearchResults(LiveTvProgramLookupInfo searchInfo, CancellationToken cancellationToken) - { - return MovieDbProvider.Current.GetMovieSearchResults(searchInfo, cancellationToken); - } - - public Task> GetMetadata(LiveTvProgramLookupInfo info, CancellationToken cancellationToken) - { - return MovieDbProvider.Current.GetItemMetadata(info, cancellationToken); - } - - public string Name - { - get { return "LiveTvMovieDbProvider"; } - } - - public Task GetImageResponse(string url, CancellationToken cancellationToken) - { - return MovieDbProvider.Current.GetImageResponse(url, cancellationToken); - } - - public int Order - { - get { return 1; } - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs b/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs index 59b4b5198..215b39181 100644 --- a/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs @@ -43,13 +43,6 @@ namespace MediaBrowser.Providers.Movies public bool Supports(IHasImages item) { - // Supports images for tv movies - var tvProgram = item as LiveTvProgram; - if (tvProgram != null && tvProgram.IsMovie) - { - return true; - } - return item is Movie || item is MusicVideo || item is Trailer; } diff --git a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs index 04d218472..f8b3ba155 100644 --- a/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbImageProvider.cs @@ -93,13 +93,6 @@ namespace MediaBrowser.Providers.Omdb public bool Supports(IHasImages item) { - // Supports images for tv movies - var tvProgram = item as LiveTvProgram; - if (tvProgram != null && tvProgram.IsMovie) - { - return true; - } - return item is Movie || item is Trailer || item is Episode; } diff --git a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs index 02cb3dbf3..e769c8cab 100644 --- a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs @@ -22,7 +22,7 @@ using System.Threading.Tasks; namespace MediaBrowser.Providers.Omdb { public class OmdbItemProvider : IRemoteMetadataProvider, - IRemoteMetadataProvider, IRemoteMetadataProvider, IRemoteMetadataProvider + IRemoteMetadataProvider, IRemoteMetadataProvider { private readonly IJsonSerializer _jsonSerializer; private readonly IHttpClient _httpClient; @@ -51,16 +51,6 @@ namespace MediaBrowser.Providers.Omdb return GetSearchResults(searchInfo, "movie", cancellationToken); } - public Task> GetSearchResults(LiveTvProgramLookupInfo searchInfo, CancellationToken cancellationToken) - { - if (!searchInfo.IsMovie) - { - return Task.FromResult>(new List()); - } - - return GetSearchResults(searchInfo, "movie", cancellationToken); - } - public Task> GetSearchResults(ItemLookupInfo searchInfo, string type, CancellationToken cancellationToken) { return GetSearchResultsInternal(searchInfo, type, true, cancellationToken); @@ -230,15 +220,6 @@ namespace MediaBrowser.Providers.Omdb return result; } - public Task> GetMetadata(LiveTvProgramLookupInfo info, CancellationToken cancellationToken) - { - if (!info.IsMovie) - { - return Task.FromResult(new MetadataResult()); - } - return GetMovieResult(info, cancellationToken); - } - public Task> GetMetadata(MovieInfo info, CancellationToken cancellationToken) { return GetMovieResult(info, cancellationToken); diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs index d424cc0ca..3b642eca2 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs @@ -107,7 +107,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers /// The metadata file. /// The settings. /// The cancellation token. - private void Fetch(MetadataResult item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken) + protected virtual void Fetch(MetadataResult item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken) { if (!SupportsUrlAfterClosingXmlTag) { @@ -233,7 +233,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers get { return "themoviedb.org/movie/"; } } - private void ParseProviderLinks(T item, string xml) + protected void ParseProviderLinks(T item, string xml) { //Look for a match for the Regex pattern "tt" followed by 7 digits Match m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase); diff --git a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs index d10a55e07..953b59f46 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs @@ -9,6 +9,8 @@ using System.Threading; using System.Xml; using MediaBrowser.Model.IO; using MediaBrowser.Model.Xml; +using System.IO; +using System.Text; namespace MediaBrowser.XbmcMetadata.Parsers { @@ -24,6 +26,65 @@ namespace MediaBrowser.XbmcMetadata.Parsers private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); + protected override void Fetch(MetadataResult item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken) + { + using (var fileStream = FileSystem.OpenRead(metadataFile)) + { + using (var streamReader = new StreamReader(fileStream, Encoding.UTF8)) + { + item.ResetPeople(); + + var xml = streamReader.ReadToEnd(); + + var srch = ""; + var index = xml.IndexOf(srch, StringComparison.OrdinalIgnoreCase); + + if (index != -1) + { + xml = xml.Substring(0, index + srch.Length); + } + + using (var ms = new MemoryStream()) + { + var bytes = Encoding.UTF8.GetBytes(xml); + + ms.Write(bytes, 0, bytes.Length); + ms.Position = 0; + + // These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions + try + { + // Use XmlReader for best performance + using (var reader = XmlReader.Create(ms, settings)) + { + reader.MoveToContent(); + reader.Read(); + + // Loop through each element + while (!reader.EOF && reader.ReadState == ReadState.Interactive) + { + cancellationToken.ThrowIfCancellationRequested(); + + if (reader.NodeType == XmlNodeType.Element) + { + FetchDataFromXmlNode(reader, item); + } + else + { + reader.Read(); + } + } + } + } + catch (XmlException) + { + + } + } + } + } + } + /// /// Fetches the data from XML node. /// diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 90663b500..ff58c13ac 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.703 + 3.0.704 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index e5cb120d3..a5707a265 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.703 + 3.0.704 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index 851db9ca8..ca38f525e 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.20.1")] +[assembly: AssemblyVersion("3.2.20.2")]