diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-05-06 00:50:39 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-05-06 00:50:39 -0400 |
| commit | 5a496a1fc8d9ee2e728d6f712ae6bdf4862183f1 (patch) | |
| tree | 70f8d08ae6cd74e08f5800136fe73728fd0ad3d0 /MediaBrowser.Server.Implementations/Dto | |
| parent | 242fb3c770a657e3c2a23ac21ec7d902879d8023 (diff) | |
reduce recursive querying
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index ff94552dad..0aec3230da 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -397,12 +397,6 @@ namespace MediaBrowser.Server.Implementations.Dto collectionFolder.GetViewType(user); } - var playlist = item as Playlist; - if (playlist != null) - { - AttachLinkedChildImages(dto, playlist, user, options); - } - if (fields.Contains(ItemFields.CanDelete)) { dto.CanDelete = user == null @@ -1564,45 +1558,6 @@ namespace MediaBrowser.Server.Implementations.Dto } } - private void AttachLinkedChildImages(BaseItemDto dto, Folder folder, User user, DtoOptions options) - { - List<BaseItem> linkedChildren = null; - - var backdropLimit = options.GetImageLimit(ImageType.Backdrop); - - if (backdropLimit > 0 && dto.BackdropImageTags.Count == 0) - { - linkedChildren = user == null - ? folder.GetRecursiveChildren().ToList() - : folder.GetRecursiveChildren(user).ToList(); - - var parentWithBackdrop = linkedChildren.FirstOrDefault(i => i.GetImages(ImageType.Backdrop).Any()); - - if (parentWithBackdrop != null) - { - dto.ParentBackdropItemId = GetDtoId(parentWithBackdrop); - dto.ParentBackdropImageTags = GetBackdropImageTags(parentWithBackdrop, backdropLimit); - } - } - - if (!dto.ImageTags.ContainsKey(ImageType.Primary) && options.GetImageLimit(ImageType.Primary) > 0) - { - if (linkedChildren == null) - { - linkedChildren = user == null - ? folder.GetRecursiveChildren().ToList() - : folder.GetRecursiveChildren(user).ToList(); - } - var parentWithImage = linkedChildren.FirstOrDefault(i => i.GetImages(ImageType.Primary).Any()); - - if (parentWithImage != null) - { - dto.ParentPrimaryImageItemId = GetDtoId(parentWithImage); - dto.ParentPrimaryImageTag = GetImageCacheTag(parentWithImage, ImageType.Primary); - } - } - } - private string GetMappedPath(IHasMetadata item) { var path = item.Path; |
