jellyfin/Emby.Dlna/ContentDirectory/ServerItem.cs

40 lines
1 KiB
C#
Raw Normal View History

2020-08-20 21:04:57 +02:00
using MediaBrowser.Controller.Entities;
namespace Emby.Dlna.ContentDirectory
{
2020-09-13 15:31:12 +02:00
/// <summary>
/// Defines the <see cref="ServerItem" />.
/// </summary>
2020-08-20 21:04:57 +02:00
internal class ServerItem
{
2020-09-13 15:31:12 +02:00
/// <summary>
/// Initializes a new instance of the <see cref="ServerItem"/> class.
/// </summary>
/// <param name="item">The <see cref="BaseItem"/>.</param>
/// <param name="stubType">The stub type.</param>
public ServerItem(BaseItem item, StubType? stubType)
2020-08-20 21:04:57 +02:00
{
Item = item;
if (stubType.HasValue)
{
StubType = stubType;
}
else if (item is IItemByName and not Folder)
2020-08-20 21:04:57 +02:00
{
StubType = Dlna.ContentDirectory.StubType.Folder;
}
}
2020-09-13 15:31:12 +02:00
/// <summary>
/// Gets the underlying base item.
2020-09-13 15:31:12 +02:00
/// </summary>
public BaseItem Item { get; }
2020-08-20 21:04:57 +02:00
2020-09-13 15:31:12 +02:00
/// <summary>
/// Gets the DLNA item type.
2020-09-13 15:31:12 +02:00
/// </summary>
public StubType? StubType { get; }
2020-08-20 21:04:57 +02:00
}
}