From a7b32d4ec0bd3f4b383078a9ecf2e2f20757bdc9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 25 Apr 2015 23:25:07 -0400 Subject: update audio transcoding bitrate --- MediaBrowser.Api/Library/LibraryService.cs | 50 +----------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) (limited to 'MediaBrowser.Api/Library/LibraryService.cs') diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 4d9afa260..f89a70340 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -591,7 +591,7 @@ namespace MediaBrowser.Api.Library ThemeSongsResult = themeSongs, ThemeVideosResult = themeVideos, - SoundtrackSongsResult = GetSoundtrackSongs(request, request.Id, request.UserId, request.InheritFromParent) + SoundtrackSongsResult = new ThemeMediaResult() }); } @@ -789,53 +789,5 @@ namespace MediaBrowser.Api.Library return ToOptimizedSerializedResultUsingCache(lookup); } - - public ThemeMediaResult GetSoundtrackSongs(GetThemeMedia request, string id, Guid? userId, bool inheritFromParent) - { - var user = userId.HasValue ? _userManager.GetUserById(userId.Value) : null; - - var item = string.IsNullOrEmpty(id) - ? (userId.HasValue - ? user.RootFolder - : _libraryManager.RootFolder) - : _libraryManager.GetItemById(id); - - var dtoOptions = GetDtoOptions(request); - - var dtos = GetSoundtrackSongIds(item, inheritFromParent) - .Select(_libraryManager.GetItemById) - .OfType() - .SelectMany(i => i.GetRecursiveChildren(a => a is Audio)) - .OrderBy(i => i.SortName) - .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); - - var items = dtos.ToArray(); - - return new ThemeMediaResult - { - Items = items, - TotalRecordCount = items.Length, - OwnerId = _dtoService.GetDtoId(item) - }; - } - - private IEnumerable GetSoundtrackSongIds(BaseItem item, bool inherit) - { - var hasSoundtracks = item as IHasSoundtracks; - - if (hasSoundtracks != null) - { - return hasSoundtracks.SoundtrackIds; - } - - if (!inherit) - { - return new List(); - } - - hasSoundtracks = item.Parents.OfType().FirstOrDefault(); - - return hasSoundtracks != null ? hasSoundtracks.SoundtrackIds : new List(); - } } } -- cgit v1.2.3