public IAlbum GetLatest(int top = 50, int sortByMetaNameId = (int)MetadataItemName.DateAdded, bool sortAscending = false, string destinationUrl = null, string filter = "mediaobject", int galleryId = int.MinValue) { IAlbum album = null; try { album = GalleryObjectController.GetMostRecentlyAddedGalleryObjects(top, ValidateGallery(galleryId), GalleryObjectTypeEnumHelper.Parse(filter, GalleryObjectType.MediaObject)); album.FeedFormatterOptions = new FeedFormatterOptions() { SortByMetaName = (MetadataItemName)sortByMetaNameId, SortAscending = sortAscending, DestinationUrl = String.IsNullOrWhiteSpace(destinationUrl) ? String.Concat(Utils.AppRoot, "/") : destinationUrl }; return(album); } catch (GallerySecurityException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden)); } catch (Exception ex) { AppEventController.LogError(ex, (album != null ? album.GalleryId : new int?())); throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = Utils.GetExStringContent(ex), ReasonPhrase = "Server Error" }); } }