mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Reduce some allocations with the magic of spans etc.
This commit is contained in:
@@ -1768,20 +1768,15 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
EnableImages = false
|
||||
}
|
||||
});
|
||||
}).TotalRecordCount;
|
||||
|
||||
double unplayedCount = unplayedQueryResult.TotalRecordCount;
|
||||
dto.UnplayedItemCount = unplayedQueryResult;
|
||||
|
||||
dto.UnplayedItemCount = unplayedQueryResult.TotalRecordCount;
|
||||
|
||||
if (itemDto != null && itemDto.RecursiveItemCount.HasValue)
|
||||
if (itemDto?.RecursiveItemCount > 0)
|
||||
{
|
||||
if (itemDto.RecursiveItemCount.Value > 0)
|
||||
{
|
||||
var unplayedPercentage = (unplayedCount / itemDto.RecursiveItemCount.Value) * 100;
|
||||
dto.PlayedPercentage = 100 - unplayedPercentage;
|
||||
dto.Played = dto.PlayedPercentage.Value >= 100;
|
||||
}
|
||||
var unplayedPercentage = ((double)unplayedQueryResult / itemDto.RecursiveItemCount.Value) * 100;
|
||||
dto.PlayedPercentage = 100 - unplayedPercentage;
|
||||
dto.Played = dto.PlayedPercentage.Value >= 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user