mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Added AudioInfo to DTOBaseItem
This commit is contained in:
parent
d776238e6b
commit
da23355fcc
@ -20,8 +20,8 @@ namespace MediaBrowser.Api
|
|||||||
return Kernel.Instance.GetItemById(guid);
|
return Kernel.Instance.GetItemById(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async static Task<DTOBaseItem> GetDTOBaseItem(BaseItem item, User user,
|
public async static Task<DTOBaseItem> GetDTOBaseItem(BaseItem item, User user,
|
||||||
bool includeChildren = true,
|
bool includeChildren = true,
|
||||||
bool includePeople = true)
|
bool includePeople = true)
|
||||||
{
|
{
|
||||||
DTOBaseItem dto = new DTOBaseItem();
|
DTOBaseItem dto = new DTOBaseItem();
|
||||||
@ -102,7 +102,22 @@ namespace MediaBrowser.Api
|
|||||||
dto.IsRoot = folder.IsRoot;
|
dto.IsRoot = folder.IsRoot;
|
||||||
dto.IsVirtualFolder = folder is VirtualFolder;
|
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;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +127,7 @@ namespace MediaBrowser.Api
|
|||||||
if (item.Studios != null)
|
if (item.Studios != null)
|
||||||
{
|
{
|
||||||
IEnumerable<Studio> entities = await Task.WhenAll<Studio>(item.Studios.Select(c => Kernel.Instance.ItemController.GetStudio(c)));
|
IEnumerable<Studio> entities = await Task.WhenAll<Studio>(item.Studios.Select(c => Kernel.Instance.ItemController.GetStudio(c)));
|
||||||
|
|
||||||
dto.Studios = item.Studios.Select(s =>
|
dto.Studios = item.Studios.Select(s =>
|
||||||
{
|
{
|
||||||
BaseItemStudio baseItemStudio = new BaseItemStudio();
|
BaseItemStudio baseItemStudio = new BaseItemStudio();
|
||||||
|
14
MediaBrowser.Model/DTO/AudioInfo.cs
Normal file
14
MediaBrowser.Model/DTO/AudioInfo.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
|
}
|
@ -90,6 +90,8 @@ namespace MediaBrowser.Model.DTO
|
|||||||
|
|
||||||
public ItemSpecialCounts SpecialCounts { get; set; }
|
public ItemSpecialCounts SpecialCounts { get; set; }
|
||||||
|
|
||||||
|
public AudioInfo AudioInfo { get; set; }
|
||||||
|
|
||||||
public bool IsType(Type type)
|
public bool IsType(Type type)
|
||||||
{
|
{
|
||||||
return IsType(type.Name);
|
return IsType(type.Name);
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="DTO\AudioInfo.cs" />
|
||||||
<Compile Include="DTO\DTOBaseItem.cs" />
|
<Compile Include="DTO\DTOBaseItem.cs" />
|
||||||
<Compile Include="Entities\Audio.cs" />
|
<Compile Include="Entities\Audio.cs" />
|
||||||
<Compile Include="Entities\BaseEntity.cs" />
|
<Compile Include="Entities\BaseEntity.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user