aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/StudiosController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Controllers/StudiosController.cs')
-rw-r--r--Jellyfin.Api/Controllers/StudiosController.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/StudiosController.cs b/Jellyfin.Api/Controllers/StudiosController.cs
index a8feb206a4..5bac850859 100644
--- a/Jellyfin.Api/Controllers/StudiosController.cs
+++ b/Jellyfin.Api/Controllers/StudiosController.cs
@@ -92,6 +92,12 @@ public class StudiosController : BaseJellyfinApiController
var dtoOptions = new DtoOptions { Fields = fields }
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);
+ // Asking for a type filter has always implied wanting that type's counts back.
+ if (includeItemTypes.Length != 0 && !dtoOptions.ContainsField(ItemFields.ItemCounts))
+ {
+ dtoOptions.Fields = [.. dtoOptions.Fields, ItemFields.ItemCounts];
+ }
+
User? user = userId.IsNullOrEmpty()
? null
: _userManager.GetUserById(userId.Value);
@@ -126,8 +132,7 @@ public class StudiosController : BaseJellyfinApiController
}
var result = _libraryManager.GetStudios(query);
- var shouldIncludeItemTypes = includeItemTypes.Length != 0;
- return RequestHelpers.CreateQueryResult(result, dtoOptions, _dtoService, shouldIncludeItemTypes, user);
+ return RequestHelpers.CreateQueryResult(result, dtoOptions, _dtoService, user);
}
/// <summary>