ServerItem.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using MediaBrowser.Controller.Entities;
  2. namespace Emby.Dlna.ContentDirectory
  3. {
  4. /// <summary>
  5. /// Defines the <see cref="ServerItem" />.
  6. /// </summary>
  7. internal class ServerItem
  8. {
  9. /// <summary>
  10. /// Initializes a new instance of the <see cref="ServerItem"/> class.
  11. /// </summary>
  12. /// <param name="item">The <see cref="BaseItem"/>.</param>
  13. /// <param name="stubType">The stub type.</param>
  14. public ServerItem(BaseItem item, StubType? stubType)
  15. {
  16. Item = item;
  17. if (stubType.HasValue)
  18. {
  19. StubType = stubType;
  20. }
  21. else if (item is IItemByName and not Folder)
  22. {
  23. StubType = Dlna.ContentDirectory.StubType.Folder;
  24. }
  25. }
  26. /// <summary>
  27. /// Gets the underlying base item.
  28. /// </summary>
  29. public BaseItem Item { get; }
  30. /// <summary>
  31. /// Gets the DLNA item type.
  32. /// </summary>
  33. public StubType? StubType { get; }
  34. }
  35. }