diff options
| author | Tavares André <tavares_and@hotmail.com> | 2015-05-07 19:12:56 +0200 |
|---|---|---|
| committer | Tavares André <tavares_and@hotmail.com> | 2015-05-07 19:12:56 +0200 |
| commit | 48e7ca87254969f98abbedcfc46985fc1ea955c0 (patch) | |
| tree | c1084f29f6529d4bf5524fdab7a723686a379b2d /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | f2b800181252b6fd0bb3b51925d1dcb0623f21d2 (diff) | |
| parent | 63dc2512c5d272dbc3cb1515beb175e9b3572440 (diff) | |
Merge branch 'dev' of https://github.com/MediaBrowser/MediaBrowser into dev
Conflicts:
MediaBrowser.Server.Implementations/Localization/Server/server.json
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 53 |
1 files changed, 2 insertions, 51 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index f89a70340..269f4cb20 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -617,36 +617,14 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); - var originalItem = item; - while (GetThemeSongIds(item).Count == 0 && request.InheritFromParent && item.Parent != null) { item = item.Parent; } - var themeSongIds = GetThemeSongIds(item); - - if (themeSongIds.Count == 0 && request.InheritFromParent) - { - var album = originalItem as MusicAlbum; - - if (album != null) - { - var linkedItemWithThemes = album.SoundtrackIds - .Select(i => _libraryManager.GetItemById(i)) - .FirstOrDefault(i => GetThemeSongIds(i).Count > 0); - - if (linkedItemWithThemes != null) - { - themeSongIds = GetThemeSongIds(linkedItemWithThemes); - item = linkedItemWithThemes; - } - } - } - var dtoOptions = GetDtoOptions(request); - var dtos = themeSongIds.Select(_libraryManager.GetItemById) + var dtos = GetThemeSongIds(item).Select(_libraryManager.GetItemById) .OrderBy(i => i.SortName) .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); @@ -682,41 +660,14 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); - var originalItem = item; - while (GetThemeVideoIds(item).Count == 0 && request.InheritFromParent && item.Parent != null) { item = item.Parent; } - var themeVideoIds = GetThemeVideoIds(item); - - if (themeVideoIds.Count == 0 && request.InheritFromParent) - { - var album = originalItem as MusicAlbum; - - if (album == null) - { - album = originalItem.Parents.OfType<MusicAlbum>().FirstOrDefault(); - } - - if (album != null) - { - var linkedItemWithThemes = album.SoundtrackIds - .Select(i => _libraryManager.GetItemById(i)) - .FirstOrDefault(i => GetThemeVideoIds(i).Count > 0); - - if (linkedItemWithThemes != null) - { - themeVideoIds = GetThemeVideoIds(linkedItemWithThemes); - item = linkedItemWithThemes; - } - } - } - var dtoOptions = GetDtoOptions(request); - var dtos = themeVideoIds.Select(_libraryManager.GetItemById) + var dtos = GetThemeVideoIds(item).Select(_libraryManager.GetItemById) .OrderBy(i => i.SortName) .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); |
