From b253b86338c613d9977a4db70bef3e5a6eb4f2c5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 03:04:18 -0500 Subject: [PATCH 1/8] update m3u media sources --- Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index 8027ce2dd7..05d71214eb 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -155,7 +155,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts ReadAtNativeFramerate = false, Id = channel.Path.GetMD5().ToString("N"), - IsInfiniteStream = true + IsInfiniteStream = true, + SupportsDirectStream = false }; return new List { mediaSource }; From ba9222898b9ad0e5165fc7d34636cdbbc3385dba Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 03:04:54 -0500 Subject: [PATCH 2/8] update intro queries --- .../Data/SqliteItemRepository.cs | 4 ++-- .../Intros/DefaultIntroProvider.cs | 10 ++++++++-- MediaBrowser.Controller/Entities/BaseItem.cs | 1 + MediaBrowser.Controller/Entities/InternalItemsQuery.cs | 3 +++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index a6119f1556..06704bafad 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -3368,9 +3368,9 @@ namespace Emby.Server.Implementations.Data } } - if (query.SimilarTo != null) + if (query.SimilarTo != null && query.MinSimilarityScore > 0) { - whereClauses.Add("SimilarityScore > 0"); + whereClauses.Add("SimilarityScore > " + (query.MinSimilarityScore - 1).ToString(CultureInfo.InvariantCulture)); } if (query.IsFolder.HasValue) diff --git a/Emby.Server.Implementations/Intros/DefaultIntroProvider.cs b/Emby.Server.Implementations/Intros/DefaultIntroProvider.cs index 180f6aba7f..90bb2f5c07 100644 --- a/Emby.Server.Implementations/Intros/DefaultIntroProvider.cs +++ b/Emby.Server.Implementations/Intros/DefaultIntroProvider.cs @@ -100,7 +100,12 @@ namespace Emby.Server.Implementations.Intros if (trailerTypes.Count > 0) { - var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery + if (trailerTypes.Count >= 5) + { + trailerTypes.Clear(); + } + + var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery(user) { IncludeItemTypes = new[] { typeof(Trailer).Name }, TrailerTypes = trailerTypes.ToArray(), @@ -111,7 +116,8 @@ namespace Emby.Server.Implementations.Intros // Account for duplicates by imdb id, since the database doesn't support this yet Limit = config.TrailerLimit * 2, - SourceTypes = sourceTypes.ToArray() + SourceTypes = sourceTypes.ToArray(), + MinSimilarityScore = 0 }).Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).Take(config.TrailerLimit); diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 9e32fd1991..c8f49820ff 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -53,6 +53,7 @@ namespace MediaBrowser.Controller.Entities ImageInfos = new List(); InheritedTags = new List(); ProductionLocations = new List(); + SourceType = SourceType.Library; } public static readonly char[] SlugReplaceChars = { '?', '/', '&' }; diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index 15af0888d5..f5af7d5c64 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -160,6 +160,7 @@ namespace MediaBrowser.Controller.Entities public DateTime? MinDateLastSaved { get; set; } public DtoOptions DtoOptions { get; set; } + public int MinSimilarityScore { get; set; } public bool HasField(ItemFields name) { @@ -197,6 +198,8 @@ namespace MediaBrowser.Controller.Entities public InternalItemsQuery() { + MinSimilarityScore = 1; + GroupByPresentationUniqueKey = true; EnableTotalRecordCount = true; From a2555630f4c74767712d1826665a59ced2667c4b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 03:08:18 -0500 Subject: [PATCH 3/8] update channel params --- MediaBrowser.Controller/Channels/ChannelMediaInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs index 1216ae3522..42ba709ab5 100644 --- a/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelMediaInfo.cs @@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.Channels Name = id, Id = id, ReadAtNativeFramerate = ReadAtNativeFramerate, - SupportsDirectStream = Protocol == MediaProtocol.File, + SupportsDirectStream = false, SupportsDirectPlay = SupportsDirectPlay }; From 552e21b8647677220ad0cf43578239a3eab3441b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 03:08:34 -0500 Subject: [PATCH 4/8] add fr-ca to languages --- Emby.Server.Implementations/Localization/iso6392.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Emby.Server.Implementations/Localization/iso6392.txt b/Emby.Server.Implementations/Localization/iso6392.txt index 665a5375e4..5616d41bc3 100644 --- a/Emby.Server.Implementations/Localization/iso6392.txt +++ b/Emby.Server.Implementations/Localization/iso6392.txt @@ -137,6 +137,7 @@ fon|||Fon|fon fre|fra|fr|French|français frm|||French, Middle (ca.1400-1600)|français moyen (1400-1600) fro|||French, Old (842-ca.1400)|français ancien (842-ca.1400) +frc||fr-ca|French (Canada)|french frr|||Northern Frisian|frison septentrional frs|||Eastern Frisian|frison oriental fry||fy|Western Frisian|frison occidental From b578877ac486a6e9c5e4e57bb7d037ff967514a9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 03:09:24 -0500 Subject: [PATCH 5/8] update hls params --- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 7 ------- .../Playback/Hls/DynamicHlsService.cs | 2 +- MediaBrowser.Api/Playback/StreamState.cs | 16 +++++++++++++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 4c9d6b69da..97072115dc 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -309,13 +309,6 @@ namespace MediaBrowser.Api.Playback.Hls return 0; } - protected bool IsLiveStream(StreamState state) - { - var isLiveStream = (state.RunTimeTicks ?? 0) == 0; - - return isLiveStream; - } - public BaseHlsService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IFileSystem fileSystem, IDlnaManager dlnaManager, ISubtitleEncoder subtitleEncoder, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager, IZipClient zipClient, IJsonSerializer jsonSerializer, IAuthorizationContext authorizationContext) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, fileSystem, dlnaManager, subtitleEncoder, deviceManager, mediaSourceManager, zipClient, jsonSerializer, authorizationContext) { } diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index cd8d05996b..e922094ada 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -521,7 +521,7 @@ namespace MediaBrowser.Api.Playback.Hls builder.AppendLine("#EXTM3U"); - var isLiveStream = IsLiveStream(state); + var isLiveStream = state.IsSegmentedLiveStream; var queryStringIndex = Request.RawUrl.IndexOf('?'); var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex); diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index e9e3c33c0e..ab0bfd502b 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -89,17 +89,25 @@ namespace MediaBrowser.Api.Playback return 10; } - if (!RunTimeTicks.HasValue) + if (IsSegmentedLiveStream) { return 3; } - return 3; + return 6; } return 3; } } + public bool IsSegmentedLiveStream + { + get + { + return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue; + } + } + public int HlsListSize { get @@ -119,8 +127,9 @@ namespace MediaBrowser.Api.Playback public List SupportedAudioCodecs { get; set; } public List SupportedVideoCodecs { get; set; } public string UserAgent { get; set; } + public TranscodingJobType TranscodingType { get; set; } - public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger) + public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType) { _mediaSourceManager = mediaSourceManager; _logger = logger; @@ -128,6 +137,7 @@ namespace MediaBrowser.Api.Playback SupportedVideoCodecs = new List(); PlayableStreamFileNames = new List(); RemoteHttpHeaders = new Dictionary(StringComparer.OrdinalIgnoreCase); + TranscodingType = transcodingType; } public string InputAudioSync { get; set; } From 9a360eeaed1dc5e4be232af9379cbb67100c4b69 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 15:45:20 -0500 Subject: [PATCH 6/8] update project --- MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index ea2b299383..7afb140ac4 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -849,9 +849,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest From ee084849a1ecfe44c8d0031c3860905115acb84d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 15:49:35 -0500 Subject: [PATCH 7/8] fix param --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 0e0a22c392..58046454ea 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1885,7 +1885,7 @@ namespace MediaBrowser.Api.Playback request.AudioCodec = InferAudioCodec(url); } - var state = new StreamState(MediaSourceManager, Logger) + var state = new StreamState(MediaSourceManager, Logger, TranscodingJobType) { Request = request, RequestedUrl = url, From b738d560bf54577618ccfeeb6d363d789042b68f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Jan 2017 15:52:56 -0500 Subject: [PATCH 8/8] update audio metadata --- .../MediaInfo/FFProbeProvider.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs index eaffc12d78..15f9853ec8 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs @@ -20,9 +20,6 @@ using System; using System.Linq; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Common.IO; -using MediaBrowser.Controller.IO; -using MediaBrowser.Model.IO; using MediaBrowser.Model.Globalization; namespace MediaBrowser.Providers.MediaInfo @@ -35,6 +32,8 @@ namespace MediaBrowser.Providers.MediaInfo ICustomMetadataProvider, ICustomMetadataProvider