< Summary - Jellyfin

Information
Class: MediaBrowser.Model.Querying.QueryResult<T>
Assembly: MediaBrowser.Model
File(s): /srv/git/jellyfin/MediaBrowser.Model/Querying/QueryResult.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 60
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
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
.ctor()100%11100%
.ctor(...)100%11100%
.ctor(...)100%22100%

File(s)

/srv/git/jellyfin/MediaBrowser.Model/Querying/QueryResult.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3
 4namespace MediaBrowser.Model.Querying;
 5
 6/// <summary>
 7/// Query result container.
 8/// </summary>
 9/// <typeparam name="T">The type of item contained in the query result.</typeparam>
 10public class QueryResult<T>
 11{
 12    /// <summary>
 13    /// Initializes a new instance of the <see cref="QueryResult{T}" /> class.
 14    /// </summary>
 15    public QueryResult()
 16    {
 417        Items = Array.Empty<T>();
 418    }
 19
 20    /// <summary>
 21    /// Initializes a new instance of the <see cref="QueryResult{T}" /> class.
 22    /// </summary>
 23    /// <param name="items">The list of items.</param>
 24    public QueryResult(IReadOnlyList<T> items)
 25    {
 426        Items = items;
 427        TotalRecordCount = items.Count;
 428    }
 29
 30    /// <summary>
 31    /// Initializes a new instance of the <see cref="QueryResult{T}" /> class.
 32    /// </summary>
 33    /// <param name="startIndex">The start index that was used to build the item list.</param>
 34    /// <param name="totalRecordCount">The total count of items.</param>
 35    /// <param name="items">The list of items.</param>
 36    public QueryResult(int? startIndex, int? totalRecordCount, IReadOnlyList<T> items)
 37    {
 14038        StartIndex = startIndex ?? 0;
 14039        TotalRecordCount = totalRecordCount ?? items.Count;
 14040        Items = items;
 14041    }
 42
 43    /// <summary>
 44    /// Gets or sets the items.
 45    /// </summary>
 46    /// <value>The items.</value>
 47    public IReadOnlyList<T> Items { get; set; }
 48
 49    /// <summary>
 50    /// Gets or sets the total number of records available.
 51    /// </summary>
 52    /// <value>The total record count.</value>
 53    public int TotalRecordCount { get; set; }
 54
 55    /// <summary>
 56    /// Gets or sets the index of the first record in Items.
 57    /// </summary>
 58    /// <value>First record index.</value>
 59    public int StartIndex { get; set; }
 60}