Merge pull request #2916 from Bond-009/minor2

Minor improvements
This commit is contained in:
dkanada 2020-04-20 13:52:27 +09:00 committed by GitHub
commit 3142c9b990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View File

@ -242,11 +242,11 @@ namespace MediaBrowser.Api.UserLibrary
return folder.GetItems(GetItemsQuery(request, dtoOptions, user)); return folder.GetItems(GetItemsQuery(request, dtoOptions, user));
} }
var itemsArray = folder.GetChildren(user, true).ToArray(); var itemsArray = folder.GetChildren(user, true);
return new QueryResult<BaseItem> return new QueryResult<BaseItem>
{ {
Items = itemsArray, Items = itemsArray,
TotalRecordCount = itemsArray.Length, TotalRecordCount = itemsArray.Count,
StartIndex = 0 StartIndex = 0
}; };
} }

View File

@ -2741,7 +2741,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var list = GetEtagValues(user); var list = GetEtagValues(user);
return string.Join("|", list.ToArray()).GetMD5().ToString("N", CultureInfo.InvariantCulture); return string.Join("|", list).GetMD5().ToString("N", CultureInfo.InvariantCulture);
} }
protected virtual List<string> GetEtagValues(User user) protected virtual List<string> GetEtagValues(User user)
@ -2784,8 +2784,7 @@ namespace MediaBrowser.Controller.Entities
return true; return true;
} }
var view = this as IHasCollectionType; if (this is IHasCollectionType view)
if (view != null)
{ {
if (string.Equals(view.CollectionType, CollectionType.LiveTv, StringComparison.OrdinalIgnoreCase)) if (string.Equals(view.CollectionType, CollectionType.LiveTv, StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -864,7 +864,7 @@ namespace MediaBrowser.Controller.Entities
return SortItemsByRequest(query, result); return SortItemsByRequest(query, result);
} }
return result.ToArray(); return result;
} }
return GetItemsInternal(query).Items; return GetItemsInternal(query).Items;

View File

@ -478,7 +478,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "I-frame image extraction failed, will attempt standard way. Input: {arguments}", inputArgument); _logger.LogError(ex, "I-frame image extraction failed, will attempt standard way. Input: {Arguments}", inputArgument);
} }
} }
@ -969,7 +969,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
public int? ExitCode { get; private set; } public int? ExitCode { get; private set; }
void OnProcessExited(object sender, EventArgs e) private void OnProcessExited(object sender, EventArgs e)
{ {
var process = (Process)sender; var process = (Process)sender;