Merge pull request #1865 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-06-21 11:28:04 -04:00 committed by GitHub
commit 437bd9a5c9
5 changed files with 17 additions and 17 deletions

View File

@ -156,8 +156,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
"create index if not exists idx_AncestorIds2 on AncestorIds(AncestorIdText)", "create index if not exists idx_AncestorIds2 on AncestorIds(AncestorIdText)",
"create table if not exists UserDataKeys (ItemId GUID, UserDataKey TEXT Priority INT, PRIMARY KEY (ItemId, UserDataKey))", "create table if not exists UserDataKeys (ItemId GUID, UserDataKey TEXT Priority INT, PRIMARY KEY (ItemId, UserDataKey))",
//"create index if not exists idx_UserDataKeys1 on UserDataKeys(ItemId)",
"create index if not exists idx_UserDataKeys2 on UserDataKeys(ItemId,Priority)",
"create table if not exists ItemValues (ItemId GUID, Type INT, Value TEXT, CleanValue TEXT)", "create table if not exists ItemValues (ItemId GUID, Type INT, Value TEXT, CleanValue TEXT)",
//"create index if not exists idx_ItemValues on ItemValues(ItemId)", //"create index if not exists idx_ItemValues on ItemValues(ItemId)",
@ -294,7 +292,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
"create index if not exists idx_TypeTopParentId7 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem,PresentationUniqueKey)", "create index if not exists idx_TypeTopParentId7 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem,PresentationUniqueKey)",
// items by name // items by name
"create index if not exists idx_ItemValues3 on ItemValues(ItemId,Type,CleanValue)" "create index if not exists idx_ItemValues3 on ItemValues(ItemId,Type,CleanValue)",
//"create index if not exists idx_UserDataKeys1 on UserDataKeys(ItemId)",
"create index if not exists idx_UserDataKeys2 on UserDataKeys(ItemId,Priority)"
}; };
_connection.RunQueries(postQueries, Logger); _connection.RunQueries(postQueries, Logger);
@ -1712,7 +1713,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
return string.Empty; return string.Empty;
} }
return " left join UserDataDb.UserData on (select UserDataKey from UserDataKeys where ItemId=Guid order by Priority LIMIT 1)=UserDataDb.UserData.Key"; return " left join UserDataDb.UserData on (select UserDataKey from UserDataKeys where ItemId=Guid order by Priority LIMIT 1)=UserDataDb.UserData.Key And (UserId=@UserId)";
} }
private string GetGroupBy(InternalItemsQuery query) private string GetGroupBy(InternalItemsQuery query)
@ -1961,11 +1962,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
{ {
if (query.User != null) if (query.User != null)
{ {
query.SortBy = new[] { "SimilarityScore", "IsPlayed", "Random" }; query.SortBy = new[] { "SimilarityScore", ItemSortBy.IsPlayed, ItemSortBy.Random };
} }
else else
{ {
query.SortBy = new[] { "SimilarityScore", "Random" }; query.SortBy = new[] { "SimilarityScore", ItemSortBy.Random };
} }
query.SortOrder = SortOrder.Descending; query.SortOrder = SortOrder.Descending;
} }
@ -2296,7 +2297,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (EnableJoinUserData(query)) if (EnableJoinUserData(query))
{ {
whereClauses.Add("(UserId is null or UserId=@UserId)"); //whereClauses.Add("(UserId is null or UserId=@UserId)");
} }
if (query.IsCurrentSchema.HasValue) if (query.IsCurrentSchema.HasValue)
{ {

View File

@ -66,6 +66,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
"create index if not exists idx_userdata on userdata(key)", "create index if not exists idx_userdata on userdata(key)",
"create unique index if not exists userdataindex on userdata (key, userId)", "create unique index if not exists userdataindex on userdata (key, userId)",
"create index if not exists userdataindex1 on userdata (key, userId)",
//pragmas //pragmas
"pragma temp_store = memory", "pragma temp_store = memory",

View File

@ -647,7 +647,7 @@ namespace MediaBrowser.Server.Startup.Common
/// <returns>Task.</returns> /// <returns>Task.</returns>
private async Task RegisterMediaEncoder(IProgress<double> progress) private async Task RegisterMediaEncoder(IProgress<double> progress)
{ {
var info = await new FFMpegLoader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager, NativeApp.Environment, NativeApp.GetType().Assembly, NativeApp.GetFfmpegInstallInfo()) var info = await new FFMpegLoader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager, NativeApp.Environment, NativeApp.GetFfmpegInstallInfo())
.GetFFMpegInfo(NativeApp.Environment, _startupOptions, progress).ConfigureAwait(false); .GetFFMpegInfo(NativeApp.Environment, _startupOptions, progress).ConfigureAwait(false);
_hasExternalEncoder = string.Equals(info.Version, "custom", StringComparison.OrdinalIgnoreCase); _hasExternalEncoder = string.Equals(info.Version, "custom", StringComparison.OrdinalIgnoreCase);

View File

@ -24,7 +24,6 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
private readonly IZipClient _zipClient; private readonly IZipClient _zipClient;
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
private readonly NativeEnvironment _environment; private readonly NativeEnvironment _environment;
private readonly Assembly _ownerAssembly;
private readonly FFMpegInstallInfo _ffmpegInstallInfo; private readonly FFMpegInstallInfo _ffmpegInstallInfo;
private readonly string[] _fontUrls = private readonly string[] _fontUrls =
@ -32,7 +31,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/ARIALUNI.7z" "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/ARIALUNI.7z"
}; };
public FFMpegLoader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient, IFileSystem fileSystem, NativeEnvironment environment, Assembly ownerAssembly, FFMpegInstallInfo ffmpegInstallInfo) public FFMpegLoader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient, IFileSystem fileSystem, NativeEnvironment environment, FFMpegInstallInfo ffmpegInstallInfo)
{ {
_logger = logger; _logger = logger;
_appPaths = appPaths; _appPaths = appPaths;
@ -40,7 +39,6 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
_zipClient = zipClient; _zipClient = zipClient;
_fileSystem = fileSystem; _fileSystem = fileSystem;
_environment = environment; _environment = environment;
_ownerAssembly = ownerAssembly;
_ffmpegInstallInfo = ffmpegInstallInfo; _ffmpegInstallInfo = ffmpegInstallInfo;
} }
@ -99,14 +97,8 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
} }
else else
{ {
// Older version found.
// Start with that. Download new version in the background.
var newPath = versionedDirectoryPath;
Task.Run(() => DownloadFFMpegInBackground(downloadInfo, newPath));
info = existingVersion; info = existingVersion;
versionedDirectoryPath = Path.GetDirectoryName(info.EncoderPath); versionedDirectoryPath = Path.GetDirectoryName(info.EncoderPath);
excludeFromDeletions.Add(versionedDirectoryPath); excludeFromDeletions.Add(versionedDirectoryPath);
} }
} }

View File

@ -134,6 +134,12 @@
<Content Include="dashboard-ui\components\metadataeditor\personeditor.template.html"> <Content Include="dashboard-ui\components\metadataeditor\personeditor.template.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\components\navdrawer\navdrawer.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\navdrawer\navdrawer.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\components\remotecontrol.js"> <Content Include="dashboard-ui\components\remotecontrol.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>