diff options
| author | David <daullmer@gmail.com> | 2020-07-22 11:02:44 +0200 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-07-22 11:02:44 +0200 |
| commit | 90039e1ad32dba8dca3b98901d2dcec1c82aeea2 (patch) | |
| tree | cafee5bd19816e5242c48acaa7e8c31b8a907278 /Jellyfin.Api/Controllers/YearsController.cs | |
| parent | eae665a9c410540bdbf3880e340fa1a7fb19be92 (diff) | |
| parent | 5b57c81ee14ce585161b9ac331e6e3528826b815 (diff) | |
Merge remote-tracking branch 'remotes/jellyfin/api-migration' into api-audio
# Conflicts:
# Emby.Server.Implementations/ApplicationHost.cs
# Jellyfin.Api/Helpers/TranscodingJobHelper.cs
Diffstat (limited to 'Jellyfin.Api/Controllers/YearsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/YearsController.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/YearsController.cs b/Jellyfin.Api/Controllers/YearsController.cs index a66a3951e..d09b016a9 100644 --- a/Jellyfin.Api/Controllers/YearsController.cs +++ b/Jellyfin.Api/Controllers/YearsController.cs @@ -74,7 +74,7 @@ namespace Jellyfin.Api.Controllers [FromQuery] bool? enableUserData, [FromQuery] int? imageTypeLimit, [FromQuery] string? enableImageTypes, - [FromQuery] Guid userId, + [FromQuery] Guid? userId, [FromQuery] bool recursive = true, [FromQuery] bool? enableImages = true) { @@ -86,9 +86,9 @@ namespace Jellyfin.Api.Controllers User? user = null; BaseItem parentItem; - if (!userId.Equals(Guid.Empty)) + if (userId.HasValue && !userId.Equals(Guid.Empty)) { - user = _userManager.GetUserById(userId); + user = _userManager.GetUserById(userId.Value); parentItem = string.IsNullOrEmpty(parentId) ? _libraryManager.GetUserRootFolder() : _libraryManager.GetItemById(parentId); } else @@ -176,7 +176,7 @@ namespace Jellyfin.Api.Controllers [HttpGet("{year}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public ActionResult<BaseItemDto> GetYear([FromRoute] int year, [FromQuery] Guid userId) + public ActionResult<BaseItemDto> GetYear([FromRoute] int year, [FromQuery] Guid? userId) { var item = _libraryManager.GetYear(year); if (item == null) @@ -187,9 +187,9 @@ namespace Jellyfin.Api.Controllers var dtoOptions = new DtoOptions() .AddClientFields(Request); - if (!userId.Equals(Guid.Empty)) + if (userId.HasValue && !userId.Equals(Guid.Empty)) { - var user = _userManager.GetUserById(userId); + var user = _userManager.GetUserById(userId.Value); return _dtoService.GetBaseItemDto(item, dtoOptions, user); } |
