diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 6635fa68b6..07fe813bdb 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -847,11 +847,15 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var channelMappings = GetChannelMappings(provider.Item2); var channelNumber = channel.Number; - string mappedChannelNumber; - if (channelMappings.TryGetValue(channelNumber, out mappedChannelNumber)) + + if (!string.IsNullOrWhiteSpace(channelNumber)) { - _logger.Debug("Found mapped channel on provider {0}. Tuner channel number: {1}, Mapped channel number: {2}", provider.Item1.Name, channelNumber, mappedChannelNumber); - channelNumber = mappedChannelNumber; + string mappedChannelNumber; + if (channelMappings.TryGetValue(channelNumber, out mappedChannelNumber)) + { + _logger.Debug("Found mapped channel on provider {0}. Tuner channel number: {1}, Mapped channel number: {2}", provider.Item1.Name, channelNumber, mappedChannelNumber); + channelNumber = mappedChannelNumber; + } } var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelNumber, channel.Name, startDateUtc, endDateUtc, cancellationToken) diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index 66db4f3f2c..abb853eb23 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -161,7 +161,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings } else { - programInfo.ShowId = ((p.Title ?? string.Empty) + (episodeTitle ?? string.Empty)).GetMD5().ToString("N"); + var uniqueString = (p.Title ?? string.Empty) + (episodeTitle ?? string.Empty); + + if (programInfo.EpisodeNumber.HasValue) + { + uniqueString = "-" + programInfo.EpisodeNumber.Value.ToString(CultureInfo.InvariantCulture); + } + + programInfo.ShowId = uniqueString.GetMD5().ToString("N"); } if (programInfo.IsMovie) diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs index 6bf4125253..9dfaa102a2 100644 --- a/Emby.Server.Implementations/TV/TVSeriesManager.cs +++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs @@ -144,11 +144,18 @@ namespace Emby.Server.Implementations.TV // If viewing all next up for all series, remove first episodes // But if that returns empty, keep those first episodes (avoid completely empty view) var alwaysEnableFirstEpisode = !string.IsNullOrWhiteSpace(request.SeriesId); + var anyFound = false; return allNextUp .Where(i => { if (alwaysEnableFirstEpisode || i.Item1 != DateTime.MinValue) + { + anyFound = true; + return true; + } + + if (!anyFound && i.Item1 == DateTime.MinValue) { return true; } diff --git a/MediaBrowser.Api/UserLibrary/PlaystateService.cs b/MediaBrowser.Api/UserLibrary/PlaystateService.cs index 5fe6c1771f..504dd29a73 100644 --- a/MediaBrowser.Api/UserLibrary/PlaystateService.cs +++ b/MediaBrowser.Api/UserLibrary/PlaystateService.cs @@ -213,6 +213,9 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")] public string MediaSourceId { get; set; } + [ApiMember(Name = "NextMediaType", Description = "The next media type that will play", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")] + public string NextMediaType { get; set; } + /// /// Gets or sets the position ticks. /// @@ -363,7 +366,8 @@ namespace MediaBrowser.Api.UserLibrary PositionTicks = request.PositionTicks, MediaSourceId = request.MediaSourceId, PlaySessionId = request.PlaySessionId, - LiveStreamId = request.LiveStreamId + LiveStreamId = request.LiveStreamId, + NextMediaType = request.NextMediaType }); } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index a0f5c129b7..ee3482a70b 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -699,16 +699,6 @@ namespace MediaBrowser.MediaEncoding.Encoder private async Task DetectInterlaced(MediaSourceInfo video, MediaStream videoStream, string inputPath, string probeSizeArgument) { - if (video.Protocol != MediaProtocol.File) - { - // If it's mpeg based, assume true - if ((videoStream.Codec ?? string.Empty).IndexOf("mpeg", StringComparison.OrdinalIgnoreCase) != -1) - { - return true; - } - return false; - } - var formats = (video.Container ?? string.Empty).Split(',').ToList(); var enableInterlacedDection = formats.Contains("vob", StringComparer.OrdinalIgnoreCase) || formats.Contains("m2ts", StringComparer.OrdinalIgnoreCase) || @@ -733,6 +723,16 @@ namespace MediaBrowser.MediaEncoding.Encoder } } + if (video.Protocol != MediaProtocol.File) + { + // If it's mpeg based, assume true + if ((videoStream.Codec ?? string.Empty).IndexOf("mpeg", StringComparison.OrdinalIgnoreCase) != -1) + { + return true; + } + return false; + } + var args = "{0} -i {1} -map 0:v:{2} -an -filter:v idet -frames:v 500 -an -f null /dev/null"; var process = _processFactory.Create(new ProcessOptions diff --git a/MediaBrowser.Model/Session/PlaybackStopInfo.cs b/MediaBrowser.Model/Session/PlaybackStopInfo.cs index 3b4ac36a74..74347f8943 100644 --- a/MediaBrowser.Model/Session/PlaybackStopInfo.cs +++ b/MediaBrowser.Model/Session/PlaybackStopInfo.cs @@ -47,5 +47,7 @@ namespace MediaBrowser.Model.Session /// /// true if failed; otherwise, false. public bool Failed { get; set; } + + public string NextMediaType { get; set; } } } \ No newline at end of file diff --git a/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs b/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs index 6788bdc9cf..ee634f157b 100644 --- a/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs +++ b/MediaBrowser.Providers/Movies/GenericMovieDbInfo.cs @@ -271,7 +271,12 @@ namespace MediaBrowser.Providers.Movies //and the rest from crew if (movieData.casts != null && movieData.casts.crew != null) { - var keepTypes = new[] { PersonType.Director, PersonType.Writer, PersonType.Producer }; + var keepTypes = new[] + { + PersonType.Director, + PersonType.Writer, + //PersonType.Producer + }; foreach (var person in movieData.casts.crew) { diff --git a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs index fcd7532648..d2191e1a64 100644 --- a/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TheMovieDb/MovieDbEpisodeProvider.cs @@ -167,7 +167,12 @@ namespace MediaBrowser.Providers.TV //and the rest from crew if (credits.crew != null) { - var keepTypes = new[] { PersonType.Director, PersonType.Writer, PersonType.Producer }; + var keepTypes = new[] + { + PersonType.Director, + //PersonType.Writer, + //PersonType.Producer + }; foreach (var person in credits.crew) { diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 7a788f6f0e..d2ec654561 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -151,10 +151,13 @@ namespace MediaBrowser.WebDashboard.Api if (index != -1) { html = html.Substring(index); + + html = html.Substring(html.IndexOf('>') + 1); + index = html.IndexOf("", StringComparison.OrdinalIgnoreCase); if (index != -1) { - html = html.Substring(0, index+7); + html = html.Substring(0, index); } } var mainFile = _fileSystem.ReadAllText(GetDashboardResourcePath("index.html"));