Merge branch 'master' into mediaencoding

This commit is contained in:
Bond-009 2019-12-12 16:34:34 +01:00
commit baadb504bb
5 changed files with 20 additions and 10 deletions

View File

@ -141,8 +141,7 @@ namespace Emby.Server.Implementations.Updates
if (guid != Guid.Empty)
{
var strGuid = guid.ToString("N", CultureInfo.InvariantCulture);
availablePackages = availablePackages.Where(x => x.guid.Equals(strGuid, StringComparison.OrdinalIgnoreCase));
availablePackages = availablePackages.Where(x => Guid.Parse(x.guid) == guid);
}
return availablePackages;

View File

@ -136,10 +136,11 @@ namespace MediaBrowser.Api
/// <returns>System.Object.</returns>
public object Get(GetPackage request)
{
var packages = _installationManager.GetAvailablePackages().Result;
var result = packages.FirstOrDefault(p => string.Equals(p.guid, request.AssemblyGuid ?? "none", StringComparison.OrdinalIgnoreCase))
?? packages.FirstOrDefault(p => p.name.Equals(request.Name, StringComparison.OrdinalIgnoreCase));
var packages = _installationManager.GetAvailablePackages().GetAwaiter().GetResult();
var result = _installationManager.FilterPackages(
packages,
request.Name,
string.IsNullOrEmpty(request.AssemblyGuid) ? default : Guid.Parse(request.AssemblyGuid)).FirstOrDefault();
return ToOptimizedResult(result);
}
@ -184,7 +185,7 @@ namespace MediaBrowser.Api
var package = _installationManager.GetCompatibleVersions(
packages,
request.Name,
new Guid(request.AssemblyGuid),
string.IsNullOrEmpty(request.AssemblyGuid) ? Guid.Empty : Guid.Parse(request.AssemblyGuid),
string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version),
request.UpdateClass).FirstOrDefault();

View File

@ -119,6 +119,7 @@ namespace MediaBrowser.Api.UserLibrary
var result = new QueryResult<BaseItemDto>
{
StartIndex = request.StartIndex.GetValueOrDefault(),
TotalRecordCount = itemsResult.TotalRecordCount,
Items = returnItems
};
@ -169,6 +170,7 @@ namespace MediaBrowser.Api.UserLibrary
return new QueryResult<BaseItemDto>
{
StartIndex = request.StartIndex.GetValueOrDefault(),
TotalRecordCount = result.TotalRecordCount,
Items = dtoList
};
@ -229,7 +231,8 @@ namespace MediaBrowser.Api.UserLibrary
return new QueryResult<BaseItem>
{
Items = Array.Empty<BaseItem>(),
TotalRecordCount = 0
TotalRecordCount = 0,
StartIndex = 0
};
}
@ -242,7 +245,8 @@ namespace MediaBrowser.Api.UserLibrary
return new QueryResult<BaseItem>
{
Items = itemsArray,
TotalRecordCount = itemsArray.Length
TotalRecordCount = itemsArray.Length,
StartIndex = 0
};
}

View File

@ -17,6 +17,12 @@ namespace MediaBrowser.Model.Querying
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
/// <summary>
/// The index of the first record in Items.
/// </summary>
/// <value>First record index.</value>
public int StartIndex { get; set; }
public QueryResult()
{
Items = Array.Empty<T>();

View File

@ -1,4 +1,4 @@
FROM microsoft/dotnet:2.2-sdk-bionic
FROM microsoft/dotnet:3.0-sdk-bionic
# Docker build arguments
ARG SOURCE_DIR=/jellyfin
ARG PLATFORM_DIR=/jellyfin/deployment/ubuntu-package-x64