mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-29 13:26:44 +01:00
Fix warnings, improve performance (#1665)
* Fix warnings, improve performance `QueryResult.Items` is now a `IReadOnlyList` so we don't need to allocate a new `Array` when we have a `List` (and `Items` shouldn't need to be mutable anyway) * Update Providers .csproj to latest C# * Remove extra newline from DtoService.cs * Remove extra newline from UserLibraryService.cs
This commit is contained in:
@@ -289,7 +289,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
var childrenResult = GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount);
|
||||
totalCount = childrenResult.TotalRecordCount;
|
||||
|
||||
provided = childrenResult.Items.Length;
|
||||
provided = childrenResult.Items.Count;
|
||||
|
||||
foreach (var i in childrenResult.Items)
|
||||
{
|
||||
@@ -309,6 +309,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
writer.WriteFullEndElement();
|
||||
//writer.WriteEndDocument();
|
||||
}
|
||||
@@ -386,7 +387,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
|
||||
totalCount = childrenResult.TotalRecordCount;
|
||||
|
||||
provided = childrenResult.Items.Length;
|
||||
provided = childrenResult.Items.Count;
|
||||
|
||||
var dlnaOptions = _config.GetDlnaConfiguration();
|
||||
|
||||
@@ -677,7 +678,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
Items = list.ToArray(),
|
||||
Items = list,
|
||||
TotalRecordCount = list.Count
|
||||
};
|
||||
}
|
||||
@@ -755,7 +756,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
Items = list.ToArray(),
|
||||
Items = list,
|
||||
TotalRecordCount = list.Count
|
||||
};
|
||||
}
|
||||
@@ -860,7 +861,7 @@ namespace Emby.Dlna.ContentDirectory
|
||||
|
||||
return new QueryResult<ServerItem>
|
||||
{
|
||||
Items = list.ToArray(),
|
||||
Items = list,
|
||||
TotalRecordCount = list.Count
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user