< Summary - Jellyfin

Information
Class: Emby.Server.Implementations.Sorting.StudioComparer
Assembly: Emby.Server.Implementations
File(s): /srv/git/jellyfin/Emby.Server.Implementations/Sorting/StudioComparer.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 34
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
get_Type()100%210%
Compare(...)100%210%

File(s)

/srv/git/jellyfin/Emby.Server.Implementations/Sorting/StudioComparer.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3using System;
 4using Jellyfin.Data.Enums;
 5using Jellyfin.Extensions;
 6using MediaBrowser.Controller.Entities;
 7using MediaBrowser.Controller.Sorting;
 8using MediaBrowser.Model.Querying;
 9
 10namespace Emby.Server.Implementations.Sorting
 11{
 12    public class StudioComparer : IBaseItemComparer
 13    {
 14        /// <summary>
 15        /// Gets the name.
 16        /// </summary>
 17        /// <value>The name.</value>
 018        public ItemSortBy Type => ItemSortBy.Studio;
 19
 20        /// <summary>
 21        /// Compares the specified x.
 22        /// </summary>
 23        /// <param name="x">The x.</param>
 24        /// <param name="y">The y.</param>
 25        /// <returns>System.Int32.</returns>
 26        public int Compare(BaseItem? x, BaseItem? y)
 27        {
 028            ArgumentNullException.ThrowIfNull(x);
 029            ArgumentNullException.ThrowIfNull(y);
 30
 031            return AlphanumericComparator.CompareValues(x.Studios.FirstOrDefault(), y.Studios.FirstOrDefault());
 32        }
 33    }
 34}