Merge pull request #1934 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-07-10 11:49:18 -04:00 committed by GitHub
commit 1b088eeb9a
15 changed files with 128 additions and 80 deletions

View File

@ -286,19 +286,25 @@ namespace MediaBrowser.Api.Playback
protected string GetH264Encoder(StreamState state)
{
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase) ||
string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "h264_qsv", StringComparison.OrdinalIgnoreCase))
// Only use alternative encoders for video files.
// When using concat with folder rips, if the mfx session fails to initialize, ffmpeg will be stuck retrying and will not exit gracefully
// Since transcoding of folder rips is expiremental anyway, it's not worth adding additional variables such as this.
if (state.VideoType == VideoType.VideoFile)
{
return "h264_qsv";
}
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase) ||
string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "h264_qsv", StringComparison.OrdinalIgnoreCase))
{
return "h264_qsv";
}
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase))
{
return "h264_nvenc";
}
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "h264_omx", StringComparison.OrdinalIgnoreCase))
{
return "h264_omx";
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "nvenc", StringComparison.OrdinalIgnoreCase))
{
return "h264_nvenc";
}
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "h264_omx", StringComparison.OrdinalIgnoreCase))
{
return "h264_omx";
}
}
return "libx264";
@ -843,6 +849,14 @@ namespace MediaBrowser.Api.Playback
return null;
}
// Only use alternative encoders for video files.
// When using concat with folder rips, if the mfx session fails to initialize, ffmpeg will be stuck retrying and will not exit gracefully
// Since transcoding of folder rips is expiremental anyway, it's not worth adding additional variables such as this.
if (state.VideoType != VideoType.VideoFile)
{
return null;
}
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec))
{
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))

View File

@ -117,7 +117,7 @@ namespace MediaBrowser.Api
config.EnableStandaloneMusicKeys = true;
config.EnableCaseSensitiveItemIds = true;
//config.EnableFolderView = true;
config.SchemaVersion = 107;
config.SchemaVersion = 108;
}
public void Post(UpdateStartupConfiguration request)

View File

@ -54,7 +54,9 @@ namespace MediaBrowser.Common.Implementations.Updates
{
if (updateLevel == PackageVersionClass.Release)
{
obj = obj.Where(i => !i.prerelease).ToArray();
// Technically all we need to do is check that it's not pre-release
// But let's addititional checks for -beta and -dev to handle builds that might be temporarily tagged incorrectly.
obj = obj.Where(i => !i.prerelease && !i.name.EndsWith("-beta", StringComparison.OrdinalIgnoreCase) && !i.name.EndsWith("-dev", StringComparison.OrdinalIgnoreCase)).ToArray();
}
else if (updateLevel == PackageVersionClass.Beta)
{

View File

@ -22,7 +22,13 @@ namespace MediaBrowser.Controller.Entities
public string SeriesName { get; set; }
[IgnoreDataMember]
public Guid? SeriesId { get; set; }
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public string FindSeriesSortName()
{
return SeriesSortName;
}
public string FindSeriesName()
{
return SeriesName;

View File

@ -760,11 +760,6 @@ namespace MediaBrowser.Controller.Entities
Logger.Debug("Query requires post-filtering due to ItemSortBy.Revenue");
return true;
}
if (query.SortBy.Contains(ItemSortBy.SeriesSortName, StringComparer.OrdinalIgnoreCase))
{
Logger.Debug("Query requires post-filtering due to ItemSortBy.SeriesSortName");
return true;
}
if (query.SortBy.Contains(ItemSortBy.VideoBitRate, StringComparer.OrdinalIgnoreCase))
{
Logger.Debug("Query requires post-filtering due to ItemSortBy.VideoBitRate");
@ -859,24 +854,6 @@ namespace MediaBrowser.Controller.Entities
return true;
}
if (query.IsMissing.HasValue)
{
Logger.Debug("Query requires post-filtering due to IsMissing");
return true;
}
if (query.IsUnaired.HasValue)
{
Logger.Debug("Query requires post-filtering due to IsUnaired");
return true;
}
if (query.IsVirtualUnaired.HasValue)
{
Logger.Debug("Query requires post-filtering due to IsVirtualUnaired");
return true;
}
if (UserViewBuilder.CollapseBoxSetItems(query, this, query.User, ConfigurationManager))
{
Logger.Debug("Query requires post-filtering due to CollapseBoxSetItems");

View File

@ -11,6 +11,8 @@ namespace MediaBrowser.Controller.Entities
/// <value>The name of the series.</value>
string SeriesName { get; set; }
string FindSeriesName();
string SeriesSortName { get; set; }
string FindSeriesSortName();
Guid? SeriesId { get; set; }
Guid? FindSeriesId();
}

View File

@ -55,6 +55,15 @@ namespace MediaBrowser.Controller.Entities.TV
/// <value>The index number.</value>
public int? IndexNumberEnd { get; set; }
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public string FindSeriesSortName()
{
var series = Series;
return series == null ? SeriesSortName : series.SortName;
}
[IgnoreDataMember]
protected override bool SupportsOwnedItems
{

View File

@ -51,6 +51,15 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public string FindSeriesSortName()
{
var series = Series;
return series == null ? SeriesSortName : series.SortName;
}
// Genre, Rating and Stuido will all be the same
protected override IEnumerable<string> GetIndexByOptions()
{

View File

@ -449,13 +449,8 @@ namespace MediaBrowser.Controller.Entities.TV
return true;
}
if (!episode.ParentIndexNumber.HasValue)
{
var season = episode.Season;
return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
}
return false;
var season = episode.Season;
return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase);
});
}

View File

@ -820,7 +820,7 @@ namespace MediaBrowser.Dlna.Didl
var episode = item as Episode;
if (episode != null)
{
var parent = (BaseItem)episode.Series ?? episode.Season;
var parent = episode.Series;
if (parent != null)
{
imageInfo = GetImageInfo(parent);

View File

@ -366,6 +366,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
return null;
}
// Only use alternative encoders for video files.
// When using concat with folder rips, if the mfx session fails to initialize, ffmpeg will be stuck retrying and will not exit gracefully
// Since transcoding of folder rips is expiremental anyway, it's not worth adding additional variables such as this.
if (state.VideoType != VideoType.VideoFile)
{
return null;
}
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec))
{
if (string.Equals(GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))

View File

@ -1932,7 +1932,7 @@ namespace MediaBrowser.Server.Implementations.Library
private string GetContentTypeOverride(string path, bool inherit)
{
var nameValuePair = ConfigurationManager.Configuration.ContentTypes.FirstOrDefault(i => string.Equals(i.Name, path, StringComparison.OrdinalIgnoreCase) || (inherit && _fileSystem.ContainsSubPath(i.Name, path)));
var nameValuePair = ConfigurationManager.Configuration.ContentTypes.FirstOrDefault(i => string.Equals(i.Name, path, StringComparison.OrdinalIgnoreCase) || (inherit && !string.IsNullOrWhiteSpace(i.Name) && _fileSystem.ContainsSubPath(i.Name, path)));
if (nameValuePair != null)
{
return nameValuePair.Value;
@ -2813,6 +2813,11 @@ namespace MediaBrowser.Server.Implementations.Library
private void RemoveContentTypeOverrides(string path)
{
if (string.IsNullOrWhiteSpace(path))
{
throw new ArgumentNullException("path");
}
var removeList = new List<NameValuePair>();
foreach (var contentType in ConfigurationManager.Configuration.ContentTypes)

View File

@ -95,7 +95,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _updateInheritedRatingCommand;
private IDbCommand _updateInheritedTagsCommand;
public const int LatestSchemaVersion = 107;
public const int LatestSchemaVersion = 108;
/// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
@ -272,6 +272,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(Logger, "TypedBaseItems", "SeasonName", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "SeasonId", "GUID");
_connection.AddColumn(Logger, "TypedBaseItems", "SeriesId", "GUID");
_connection.AddColumn(Logger, "TypedBaseItems", "SeriesSortName", "Text");
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
@ -412,7 +413,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"SeriesName",
"SeasonName",
"SeasonId",
"SeriesId"
"SeriesId",
"SeriesSortName"
};
private readonly string[] _mediaStreamSaveColumns =
@ -535,7 +537,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"UserDataKey",
"SeasonName",
"SeasonId",
"SeriesId"
"SeriesId",
"SeriesSortName"
};
_saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
@ -982,10 +985,12 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (hasSeries != null)
{
_saveItemCommand.GetParameter(index++).Value = hasSeries.FindSeriesId();
_saveItemCommand.GetParameter(index++).Value = hasSeries.FindSeriesSortName();
}
else
{
_saveItemCommand.GetParameter(index++).Value = null;
_saveItemCommand.GetParameter(index++).Value = null;
}
_saveItemCommand.Transaction = transaction;
@ -1440,6 +1445,14 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
if (hasSeries != null)
{
if (!reader.IsDBNull(63))
{
hasSeries.SeriesSortName = reader.GetString(63);
}
}
return item;
}
@ -3056,6 +3069,39 @@ namespace MediaBrowser.Server.Implementations.Persistence
whereClauses.Add("LocationType<>'Virtual'");
}
}
if (query.IsUnaired.HasValue)
{
if (query.IsUnaired.Value)
{
whereClauses.Add("PremiereDate >= DATETIME('now')");
}
else
{
whereClauses.Add("PremiereDate < DATETIME('now')");
}
}
if (query.IsMissing.HasValue && _config.Configuration.SchemaVersion >= 90)
{
if (query.IsMissing.Value)
{
whereClauses.Add("(IsVirtualItem=1 AND PremiereDate < DATETIME('now'))");
}
else
{
whereClauses.Add("(IsVirtualItem=0 OR PremiereDate >= DATETIME('now'))");
}
}
if (query.IsVirtualUnaired.HasValue && _config.Configuration.SchemaVersion >= 90)
{
if (query.IsVirtualUnaired.Value)
{
whereClauses.Add("(IsVirtualItem=1 AND PremiereDate >= DATETIME('now'))");
}
else
{
whereClauses.Add("(IsVirtualItem=0 OR PremiereDate < DATETIME('now'))");
}
}
if (query.MediaTypes.Length == 1)
{
whereClauses.Add("MediaType=@MediaTypes");

View File

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
using System;
@ -21,28 +20,9 @@ namespace MediaBrowser.Server.Implementations.Sorting
private string GetValue(BaseItem item)
{
Series series = null;
var hasSeries = item as IHasSeries;
var season = item as Season;
if (season != null)
{
series = season.Series;
}
var episode = item as Episode;
if (episode != null)
{
series = episode.Series;
}
if (series == null)
{
series = item as Series;
}
return series != null ? series.SortName : null;
return hasSeries != null ? hasSeries.SeriesSortName : null;
}
/// <summary>

View File

@ -349,8 +349,8 @@ namespace MediaBrowser.WebDashboard.Api
}
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "jquery", "src"), true);
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "flash"), true);
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "specs"), true);
//_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "flash"), true);
//_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "fingerprintjs2", "specs"), true);
DeleteCryptoFiles(Path.Combine(bowerPath, "cryptojslib", "components"));
@ -358,12 +358,7 @@ namespace MediaBrowser.WebDashboard.Api
DeleteFoldersByName(Path.Combine(bowerPath, "jstree"), "src");
DeleteFoldersByName(Path.Combine(bowerPath, "Sortable"), "meteor");
DeleteFoldersByName(Path.Combine(bowerPath, "Sortable"), "st");
DeleteFoldersByName(Path.Combine(bowerPath, "Swiper"), "src");
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "marked"), true);
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "marked-element"), true);
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "prism"), true);
_fileSystem.DeleteDirectory(Path.Combine(bowerPath, "prism-element"), true);
//DeleteFoldersByName(Path.Combine(bowerPath, "Swiper"), "src");
if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
{