diff --git a/MediaBrowser.Api/ApiService.cs b/MediaBrowser.Api/ApiService.cs index f6db26928..99b25f94e 100644 --- a/MediaBrowser.Api/ApiService.cs +++ b/MediaBrowser.Api/ApiService.cs @@ -20,8 +20,8 @@ namespace MediaBrowser.Api return Kernel.Instance.GetItemById(guid); } - public async static Task GetDTOBaseItem(BaseItem item, User user, - bool includeChildren = true, + public async static Task GetDTOBaseItem(BaseItem item, User user, + bool includeChildren = true, bool includePeople = true) { DTOBaseItem dto = new DTOBaseItem(); @@ -102,7 +102,22 @@ namespace MediaBrowser.Api dto.IsRoot = folder.IsRoot; dto.IsVirtualFolder = folder is VirtualFolder; } - + + Audio audio = item as Audio; + + if (audio != null) + { + dto.AudioInfo = new AudioInfo() + { + Album = audio.Album, + AlbumArtist = audio.AlbumArtist, + Artist = audio.Artist, + BitRate = audio.BitRate, + Channels = audio.Channels, + Composer = audio.Composer + }; + } + return dto; } @@ -112,7 +127,7 @@ namespace MediaBrowser.Api if (item.Studios != null) { IEnumerable entities = await Task.WhenAll(item.Studios.Select(c => Kernel.Instance.ItemController.GetStudio(c))); - + dto.Studios = item.Studios.Select(s => { BaseItemStudio baseItemStudio = new BaseItemStudio(); diff --git a/MediaBrowser.Model/DTO/AudioInfo.cs b/MediaBrowser.Model/DTO/AudioInfo.cs new file mode 100644 index 000000000..3aa1cc1bf --- /dev/null +++ b/MediaBrowser.Model/DTO/AudioInfo.cs @@ -0,0 +1,14 @@ + +namespace MediaBrowser.Model.DTO +{ + public class AudioInfo + { + public int BitRate { get; set; } + public int Channels { get; set; } + + public string Artist { get; set; } + public string Album { get; set; } + public string AlbumArtist { get; set; } + public string Composer { get; set; } + } +} diff --git a/MediaBrowser.Model/DTO/DTOBaseItem.cs b/MediaBrowser.Model/DTO/DTOBaseItem.cs index 9bc86a6b1..fb77c2595 100644 --- a/MediaBrowser.Model/DTO/DTOBaseItem.cs +++ b/MediaBrowser.Model/DTO/DTOBaseItem.cs @@ -90,6 +90,8 @@ namespace MediaBrowser.Model.DTO public ItemSpecialCounts SpecialCounts { get; set; } + public AudioInfo AudioInfo { get; set; } + public bool IsType(Type type) { return IsType(type.Name); diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 60defff43..70e4c729e 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -32,6 +32,7 @@ 4 +