Merge remote-tracking branch 'upstream/master'

pull/702/head
Tim Hobbs 11 years ago
commit cf5e89d045

@ -1358,6 +1358,8 @@ namespace MediaBrowser.Api.Playback
state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress; state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress;
state.AudioSync = "1000"; state.AudioSync = "1000";
state.DeInterlace = true; state.DeInterlace = true;
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
} }
else if (item is LiveTvChannel) else if (item is LiveTvChannel)
{ {
@ -1387,6 +1389,8 @@ namespace MediaBrowser.Api.Playback
state.ReadInputAtNativeFramerate = true; state.ReadInputAtNativeFramerate = true;
state.AudioSync = "1000"; state.AudioSync = "1000";
state.DeInterlace = true; state.DeInterlace = true;
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
} }
else else
{ {
@ -1503,6 +1507,16 @@ namespace MediaBrowser.Api.Playback
inputModifier += " -acodec " + state.InputAudioCodec; inputModifier += " -acodec " + state.InputAudioCodec;
} }
if (!string.IsNullOrEmpty(state.InputAudioSync))
{
inputModifier += " -async " + state.InputAudioSync;
}
if (!string.IsNullOrEmpty(state.InputVideoSync))
{
inputModifier += " -vsync " + state.InputVideoSync;
}
if (state.ReadInputAtNativeFramerate) if (state.ReadInputAtNativeFramerate)
{ {
inputModifier += " -re"; inputModifier += " -re";

@ -64,6 +64,9 @@ namespace MediaBrowser.Api.Playback
public string AudioSync = "1"; public string AudioSync = "1";
public string VideoSync = "vfr"; public string VideoSync = "vfr";
public string InputAudioSync { get; set; }
public string InputVideoSync { get; set; }
public bool DeInterlace { get; set; } public bool DeInterlace { get; set; }
public bool ReadInputAtNativeFramerate { get; set; } public bool ReadInputAtNativeFramerate { get; set; }

@ -418,12 +418,13 @@ namespace MediaBrowser.Controller.Entities
{ {
IEnumerable<FileSystemInfo> files; IEnumerable<FileSystemInfo> files;
var path = Path;
var currentFilename = System.IO.Path.GetFileNameWithoutExtension(path) ?? string.Empty;
// Only support this for video files. For folder rips, they'll have to use the linking feature // Only support this for video files. For folder rips, they'll have to use the linking feature
if (VideoType == VideoType.VideoFile || VideoType == VideoType.Iso) if (VideoType == VideoType.VideoFile || VideoType == VideoType.Iso)
{ {
var path = Path;
var filenamePrefix = System.IO.Path.GetFileName(System.IO.Path.GetDirectoryName(path));
files = fileSystemChildren.Where(i => files = fileSystemChildren.Where(i =>
{ {
if ((i.Attributes & FileAttributes.Directory) == FileAttributes.Directory) if ((i.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
@ -433,7 +434,7 @@ namespace MediaBrowser.Controller.Entities
return !string.Equals(i.FullName, path, StringComparison.OrdinalIgnoreCase) && return !string.Equals(i.FullName, path, StringComparison.OrdinalIgnoreCase) &&
EntityResolutionHelper.IsVideoFile(i.FullName) && EntityResolutionHelper.IsVideoFile(i.FullName) &&
i.Name.StartsWith(currentFilename, StringComparison.OrdinalIgnoreCase); i.Name.StartsWith(filenamePrefix + " - ", StringComparison.OrdinalIgnoreCase);
}); });
} }
else else

@ -51,6 +51,11 @@ namespace MediaBrowser.Model.Querying
/// </summary> /// </summary>
DisplayPreferencesId, DisplayPreferencesId,
/// <summary>
/// The display media type
/// </summary>
DisplayMediaType,
/// <summary> /// <summary>
/// The external urls /// The external urls
/// </summary> /// </summary>

@ -725,7 +725,11 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.DateCreated = item.DateCreated; dto.DateCreated = item.DateCreated;
} }
if (fields.Contains(ItemFields.DisplayMediaType))
{
dto.DisplayMediaType = item.DisplayMediaType; dto.DisplayMediaType = item.DisplayMediaType;
}
dto.IsUnidentified = item.IsUnidentified; dto.IsUnidentified = item.IsUnidentified;
if (fields.Contains(ItemFields.Settings)) if (fields.Contains(ItemFields.Settings))
@ -1351,7 +1355,7 @@ namespace MediaBrowser.Server.Implementations.Dto
{ {
var name = ""; var name = "";
var stream = video.GetDefaultVideoStream(); var videoStream = video.GetDefaultVideoStream();
if (video.Video3DFormat.HasValue) if (video.Video3DFormat.HasValue)
{ {
@ -1393,28 +1397,27 @@ namespace MediaBrowser.Server.Implementations.Dto
} }
name = name.Trim(); name = name.Trim();
} }
else if (video.VideoType == VideoType.VideoFile)
{ if (videoStream != null)
if (stream != null)
{ {
if (stream.Width.HasValue) if (videoStream.Width.HasValue)
{ {
if (stream.Width.Value >= 3800) if (videoStream.Width.Value >= 3800)
{ {
name = name + " " + "4K"; name = name + " " + "4K";
name = name.Trim(); name = name.Trim();
} }
else if (stream.Width.Value >= 1900) else if (videoStream.Width.Value >= 1900)
{ {
name = name + " " + "1080P"; name = name + " " + "1080P";
name = name.Trim(); name = name.Trim();
} }
else if (stream.Width.Value >= 1270) else if (videoStream.Width.Value >= 1270)
{ {
name = name + " " + "720P"; name = name + " " + "720P";
name = name.Trim(); name = name.Trim();
} }
else if (stream.Width.Value >= 700) else if (videoStream.Width.Value >= 700)
{ {
name = name + " " + "480p"; name = name + " " + "480p";
name = name.Trim(); name = name.Trim();
@ -1426,11 +1429,10 @@ namespace MediaBrowser.Server.Implementations.Dto
} }
} }
} }
}
if (stream != null && !string.IsNullOrWhiteSpace(stream.Codec)) if (videoStream != null && !string.IsNullOrWhiteSpace(videoStream.Codec))
{ {
name = name + " " + stream.Codec.ToUpper(); name = name + " " + videoStream.Codec.ToUpper();
name = name.Trim(); name = name.Trim();
} }

@ -396,7 +396,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
private T GetMovieWithAlternateVersions<T>(IEnumerable<T> movies) private T GetMovieWithAlternateVersions<T>(IEnumerable<T> movies)
where T : Video, new() where T : Video, new()
{ {
var sortedMovies = movies.OrderBy(i => i.Path.Length).ToList(); var sortedMovies = movies.OrderBy(i => i.Path).ToList();
// Cap this at five to help avoid incorrect matching // Cap this at five to help avoid incorrect matching
if (sortedMovies.Count > 5) if (sortedMovies.Count > 5)
@ -406,11 +406,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
var firstMovie = sortedMovies[0]; var firstMovie = sortedMovies[0];
var filenamePrefix = Path.GetFileNameWithoutExtension(firstMovie.Path); var filenamePrefix = Path.GetFileName(Path.GetDirectoryName(firstMovie.Path));
if (!string.IsNullOrWhiteSpace(filenamePrefix)) if (!string.IsNullOrWhiteSpace(filenamePrefix))
{ {
if (sortedMovies.Skip(1).All(i => Path.GetFileNameWithoutExtension(i.Path).StartsWith(filenamePrefix + " - ", StringComparison.OrdinalIgnoreCase))) if (sortedMovies.All(i => Path.GetFileNameWithoutExtension(i.Path).StartsWith(filenamePrefix + " - ", StringComparison.OrdinalIgnoreCase)))
{ {
firstMovie.HasLocalAlternateVersions = true; firstMovie.HasLocalAlternateVersions = true;

@ -162,7 +162,9 @@
<Content Include="dashboard-ui\css\images\icons\audiocd.png"> <Content Include="dashboard-ui\css\images\icons\audiocd.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\css\images\icons\filter.png" /> <Content Include="dashboard-ui\css\images\icons\filter.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\icons\mute.png"> <Content Include="dashboard-ui\css\images\icons\mute.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

Loading…
Cancel
Save