Merge branch 'beta' of https://github.com/MediaBrowser/Emby into beta

This commit is contained in:
Luke Pulverenti 2017-01-31 16:31:43 -05:00
commit 8cef129580
9 changed files with 56 additions and 19 deletions

View File

@ -847,12 +847,16 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var channelMappings = GetChannelMappings(provider.Item2); var channelMappings = GetChannelMappings(provider.Item2);
var channelNumber = channel.Number; var channelNumber = channel.Number;
if (!string.IsNullOrWhiteSpace(channelNumber))
{
string mappedChannelNumber; string mappedChannelNumber;
if (channelMappings.TryGetValue(channelNumber, out 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); _logger.Debug("Found mapped channel on provider {0}. Tuner channel number: {1}, Mapped channel number: {2}", provider.Item1.Name, channelNumber, mappedChannelNumber);
channelNumber = mappedChannelNumber; channelNumber = mappedChannelNumber;
} }
}
var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelNumber, channel.Name, startDateUtc, endDateUtc, cancellationToken) var programs = await provider.Item1.GetProgramsAsync(provider.Item2, channelNumber, channel.Name, startDateUtc, endDateUtc, cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);

View File

@ -161,7 +161,14 @@ namespace Emby.Server.Implementations.LiveTv.Listings
} }
else 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) if (programInfo.IsMovie)

View File

@ -144,11 +144,18 @@ namespace Emby.Server.Implementations.TV
// If viewing all next up for all series, remove first episodes // If viewing all next up for all series, remove first episodes
// But if that returns empty, keep those first episodes (avoid completely empty view) // But if that returns empty, keep those first episodes (avoid completely empty view)
var alwaysEnableFirstEpisode = !string.IsNullOrWhiteSpace(request.SeriesId); var alwaysEnableFirstEpisode = !string.IsNullOrWhiteSpace(request.SeriesId);
var anyFound = false;
return allNextUp return allNextUp
.Where(i => .Where(i =>
{ {
if (alwaysEnableFirstEpisode || i.Item1 != DateTime.MinValue) if (alwaysEnableFirstEpisode || i.Item1 != DateTime.MinValue)
{
anyFound = true;
return true;
}
if (!anyFound && i.Item1 == DateTime.MinValue)
{ {
return true; return true;
} }

View File

@ -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")] [ApiMember(Name = "MediaSourceId", Description = "The id of the MediaSource", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
public string MediaSourceId { get; set; } 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; }
/// <summary> /// <summary>
/// Gets or sets the position ticks. /// Gets or sets the position ticks.
/// </summary> /// </summary>
@ -363,7 +366,8 @@ namespace MediaBrowser.Api.UserLibrary
PositionTicks = request.PositionTicks, PositionTicks = request.PositionTicks,
MediaSourceId = request.MediaSourceId, MediaSourceId = request.MediaSourceId,
PlaySessionId = request.PlaySessionId, PlaySessionId = request.PlaySessionId,
LiveStreamId = request.LiveStreamId LiveStreamId = request.LiveStreamId,
NextMediaType = request.NextMediaType
}); });
} }

View File

@ -699,16 +699,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
private async Task<bool> DetectInterlaced(MediaSourceInfo video, MediaStream videoStream, string inputPath, string probeSizeArgument) private async Task<bool> 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 formats = (video.Container ?? string.Empty).Split(',').ToList();
var enableInterlacedDection = formats.Contains("vob", StringComparer.OrdinalIgnoreCase) || var enableInterlacedDection = formats.Contains("vob", StringComparer.OrdinalIgnoreCase) ||
formats.Contains("m2ts", 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 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 var process = _processFactory.Create(new ProcessOptions

View File

@ -47,5 +47,7 @@ namespace MediaBrowser.Model.Session
/// </summary> /// </summary>
/// <value><c>true</c> if failed; otherwise, <c>false</c>.</value> /// <value><c>true</c> if failed; otherwise, <c>false</c>.</value>
public bool Failed { get; set; } public bool Failed { get; set; }
public string NextMediaType { get; set; }
} }
} }

View File

@ -271,7 +271,12 @@ namespace MediaBrowser.Providers.Movies
//and the rest from crew //and the rest from crew
if (movieData.casts != null && movieData.casts.crew != null) 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) foreach (var person in movieData.casts.crew)
{ {

View File

@ -167,7 +167,12 @@ namespace MediaBrowser.Providers.TV
//and the rest from crew //and the rest from crew
if (credits.crew != null) 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) foreach (var person in credits.crew)
{ {

View File

@ -151,10 +151,13 @@ namespace MediaBrowser.WebDashboard.Api
if (index != -1) if (index != -1)
{ {
html = html.Substring(index); html = html.Substring(index);
html = html.Substring(html.IndexOf('>') + 1);
index = html.IndexOf("</body>", StringComparison.OrdinalIgnoreCase); index = html.IndexOf("</body>", StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
html = html.Substring(0, index+7); html = html.Substring(0, index);
} }
} }
var mainFile = _fileSystem.ReadAllText(GetDashboardResourcePath("index.html")); var mainFile = _fileSystem.ReadAllText(GetDashboardResourcePath("index.html"));