diff options
| author | crobibero <cody@robibe.ro> | 2020-12-01 11:07:41 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-01 11:07:41 -0700 |
| commit | c083b29e292c72b65929ea05639e3b5a8a401037 (patch) | |
| tree | 68c48427a88ade6acdef401aff3a03324099273d /Jellyfin.Api/Controllers/GenresController.cs | |
| parent | f660969e6c5bd3fc8b3898277e1f8d23d557816e (diff) | |
Use Guid as API parameter type where possible
Diffstat (limited to 'Jellyfin.Api/Controllers/GenresController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/GenresController.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/GenresController.cs b/Jellyfin.Api/Controllers/GenresController.cs index d2b41e0a8..b6755ed5e 100644 --- a/Jellyfin.Api/Controllers/GenresController.cs +++ b/Jellyfin.Api/Controllers/GenresController.cs @@ -72,7 +72,7 @@ namespace Jellyfin.Api.Controllers [FromQuery] int? startIndex, [FromQuery] int? limit, [FromQuery] string? searchTerm, - [FromQuery] string? parentId, + [FromQuery] Guid? parentId, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] excludeItemTypes, [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] includeItemTypes, @@ -109,15 +109,15 @@ namespace Jellyfin.Api.Controllers EnableTotalRecordCount = enableTotalRecordCount }; - if (!string.IsNullOrWhiteSpace(parentId)) + if (parentId.HasValue) { if (parentItem is Folder) { - query.AncestorIds = new[] { new Guid(parentId) }; + query.AncestorIds = new[] { parentId.Value }; } else { - query.ItemIds = new[] { new Guid(parentId) }; + query.ItemIds = new[] { parentId.Value }; } } |
