public async Task <IActionResult> GetMediaItemsForAlbumId(int id, int sortByMetaNameId = int.MinValue, bool sortAscending = true) { // GET /api/albums/mediaitems/12 - Gets media items for album #12 try { return(new JsonResult(await _galleryObjectController.GetMediaItemsInAlbum(id, (MetadataItemName)sortByMetaNameId, sortAscending))); } catch (InvalidAlbumException) { return(NotFound($"Could not find album with ID {id}.")); } catch (GallerySecurityException ex) { AppEventController.LogError(ex); return(Forbid()); } catch (Exception ex) { AppEventController.LogError(ex); return(StatusCode(500, _exController.GetExString(ex))); } }