using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Model.System;
namespace Jellyfin.Api.Models.SystemInfoDtos;
///
/// Contains informations about a libraries storage informations.
///
public record LibraryStorageDto
{
///
/// Gets or sets the Library Id.
///
public required Guid Id { get; set; }
///
/// Gets or sets the name of the library.
///
public required string Name { get; set; }
///
/// Gets or sets the storage informations about the folders used in a library.
///
public required IReadOnlyCollection Folders { get; set; }
internal static LibraryStorageDto FromLibraryStorageModel(LibraryStorageInfo model)
{
return new()
{
Id = model.Id,
Name = model.Name,
Folders = model.Folders.Select(FolderStorageDto.FromFolderStorageInfo).ToArray()
};
}
}