FolderStorageDto.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using MediaBrowser.Model.System;
  2. namespace Jellyfin.Api.Models.SystemInfoDtos;
  3. /// <summary>
  4. /// Contains information about a specific folder.
  5. /// </summary>
  6. public record FolderStorageDto
  7. {
  8. /// <summary>
  9. /// Gets the path of the folder in question.
  10. /// </summary>
  11. public required string Path { get; init; }
  12. /// <summary>
  13. /// Gets the free space of the underlying storage device of the <see cref="Path"/>.
  14. /// </summary>
  15. public long FreeSpace { get; init; }
  16. /// <summary>
  17. /// Gets the used space of the underlying storage device of the <see cref="Path"/>.
  18. /// </summary>
  19. public long UsedSpace { get; init; }
  20. /// <summary>
  21. /// Gets the kind of storage device of the <see cref="Path"/>.
  22. /// </summary>
  23. public string? StorageType { get; init; }
  24. /// <summary>
  25. /// Gets the Device Identifier.
  26. /// </summary>
  27. public string? DeviceId { get; init; }
  28. internal static FolderStorageDto FromFolderStorageInfo(FolderStorageInfo model)
  29. {
  30. return new()
  31. {
  32. Path = model.Path,
  33. FreeSpace = model.FreeSpace,
  34. UsedSpace = model.UsedSpace,
  35. StorageType = model.StorageType,
  36. DeviceId = model.DeviceId
  37. };
  38. }
  39. }