Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Tim Hobbs 2014-03-21 11:40:54 -07:00
commit cf5e89d045
7 changed files with 67 additions and 40 deletions

View File

@ -1358,6 +1358,8 @@ namespace MediaBrowser.Api.Playback
state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress;
state.AudioSync = "1000";
state.DeInterlace = true;
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
}
else if (item is LiveTvChannel)
{
@ -1387,6 +1389,8 @@ namespace MediaBrowser.Api.Playback
state.ReadInputAtNativeFramerate = true;
state.AudioSync = "1000";
state.DeInterlace = true;
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
}
else
{
@ -1503,6 +1507,16 @@ namespace MediaBrowser.Api.Playback
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)
{
inputModifier += " -re";

View File

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

View File

@ -418,12 +418,13 @@ namespace MediaBrowser.Controller.Entities
{
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
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 =>
{
if ((i.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
@ -433,7 +434,7 @@ namespace MediaBrowser.Controller.Entities
return !string.Equals(i.FullName, path, StringComparison.OrdinalIgnoreCase) &&
EntityResolutionHelper.IsVideoFile(i.FullName) &&
i.Name.StartsWith(currentFilename, StringComparison.OrdinalIgnoreCase);
i.Name.StartsWith(filenamePrefix + " - ", StringComparison.OrdinalIgnoreCase);
});
}
else

View File

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

View File

@ -725,7 +725,11 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.DateCreated = item.DateCreated;
}
dto.DisplayMediaType = item.DisplayMediaType;
if (fields.Contains(ItemFields.DisplayMediaType))
{
dto.DisplayMediaType = item.DisplayMediaType;
}
dto.IsUnidentified = item.IsUnidentified;
if (fields.Contains(ItemFields.Settings))
@ -1351,7 +1355,7 @@ namespace MediaBrowser.Server.Implementations.Dto
{
var name = "";
var stream = video.GetDefaultVideoStream();
var videoStream = video.GetDefaultVideoStream();
if (video.Video3DFormat.HasValue)
{
@ -1393,44 +1397,42 @@ namespace MediaBrowser.Server.Implementations.Dto
}
name = name.Trim();
}
else if (video.VideoType == VideoType.VideoFile)
if (videoStream != null)
{
if (stream != null)
if (videoStream.Width.HasValue)
{
if (stream.Width.HasValue)
if (videoStream.Width.Value >= 3800)
{
if (stream.Width.Value >= 3800)
{
name = name + " " + "4K";
name = name.Trim();
}
else if (stream.Width.Value >= 1900)
{
name = name + " " + "1080P";
name = name.Trim();
}
else if (stream.Width.Value >= 1270)
{
name = name + " " + "720P";
name = name.Trim();
}
else if (stream.Width.Value >= 700)
{
name = name + " " + "480p";
name = name.Trim();
}
else
{
name = name + " " + "SD";
name = name.Trim();
}
name = name + " " + "4K";
name = name.Trim();
}
else if (videoStream.Width.Value >= 1900)
{
name = name + " " + "1080P";
name = name.Trim();
}
else if (videoStream.Width.Value >= 1270)
{
name = name + " " + "720P";
name = name.Trim();
}
else if (videoStream.Width.Value >= 700)
{
name = name + " " + "480p";
name = name.Trim();
}
else
{
name = name + " " + "SD";
name = name.Trim();
}
}
}
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();
}

View File

@ -396,7 +396,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
private T GetMovieWithAlternateVersions<T>(IEnumerable<T> movies)
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
if (sortedMovies.Count > 5)
@ -406,11 +406,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
var firstMovie = sortedMovies[0];
var filenamePrefix = Path.GetFileNameWithoutExtension(firstMovie.Path);
var filenamePrefix = Path.GetFileName(Path.GetDirectoryName(firstMovie.Path));
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;

View File

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