< Summary - Jellyfin

Information
Class: Jellyfin.Api.Models.SystemInfoDtos.LibraryStorageDto
Assembly: Jellyfin.Api
File(s): /srv/git/jellyfin/Jellyfin.Api/Models/SystemInfoDtos/LibraryStorageDto.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 37
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FromLibraryStorageModel(...)100%210%

File(s)

/srv/git/jellyfin/Jellyfin.Api/Models/SystemInfoDtos/LibraryStorageDto.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using MediaBrowser.Model.System;
 5
 6namespace Jellyfin.Api.Models.SystemInfoDtos;
 7
 8/// <summary>
 9/// Contains informations about a libraries storage informations.
 10/// </summary>
 11public record LibraryStorageDto
 12{
 13      /// <summary>
 14    /// Gets or sets the Library Id.
 15    /// </summary>
 16    public required Guid Id { get; set; }
 17
 18    /// <summary>
 19    /// Gets or sets the name of the library.
 20    /// </summary>
 21    public required string Name { get; set; }
 22
 23    /// <summary>
 24    /// Gets or sets the storage informations about the folders used in a library.
 25    /// </summary>
 26    public required IReadOnlyCollection<FolderStorageDto> Folders { get; set; }
 27
 28    internal static LibraryStorageDto FromLibraryStorageModel(LibraryStorageInfo model)
 29    {
 030        return new()
 031        {
 032            Id = model.Id,
 033            Name = model.Name,
 034            Folders = model.Folders.Select(FolderStorageDto.FromFolderStorageInfo).ToArray()
 035        };
 36    }
 37}