diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index 6635fa68b..07fe813bd 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 66db4f3f2..abb853eb2 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 6bf412525..9dfaa102a 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 5fe6c1771..504dd29a7 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 a0f5c129b..ee3482a70 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 3b4ac36a7..74347f894 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 6788bdc9c..ee634f157 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 fcd753264..d2191e1a6 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 7a788f6f0..d2ec65456 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"));