diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-04-25 23:25:07 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-04-25 23:25:07 -0400 |
| commit | a7b32d4ec0bd3f4b383078a9ecf2e2f20757bdc9 (patch) | |
| tree | 47968bca3df37bc31debb84060df806dc30b3610 /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | 25cdbf014e16c7607605ee7287adcc953bba6211 (diff) | |
update audio transcoding bitrate
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 50 |
1 files changed, 1 insertions, 49 deletions
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<MusicAlbum>() - .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<Guid> GetSoundtrackSongIds(BaseItem item, bool inherit) - { - var hasSoundtracks = item as IHasSoundtracks; - - if (hasSoundtracks != null) - { - return hasSoundtracks.SoundtrackIds; - } - - if (!inherit) - { - return new List<Guid>(); - } - - hasSoundtracks = item.Parents.OfType<IHasSoundtracks>().FirstOrDefault(); - - return hasSoundtracks != null ? hasSoundtracks.SoundtrackIds : new List<Guid>(); - } } } |
