| | | 1 | | #pragma warning disable CS1591 |
| | | 2 | | |
| | | 3 | | using System; |
| | | 4 | | using Jellyfin.Data.Enums; |
| | | 5 | | using Jellyfin.Extensions; |
| | | 6 | | using MediaBrowser.Controller.Entities; |
| | | 7 | | using MediaBrowser.Controller.Sorting; |
| | | 8 | | using MediaBrowser.Model.Querying; |
| | | 9 | | |
| | | 10 | | namespace Emby.Server.Implementations.Sorting |
| | | 11 | | { |
| | | 12 | | public class StudioComparer : IBaseItemComparer |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Gets the name. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <value>The name.</value> |
| | 0 | 18 | | 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 | | { |
| | 0 | 28 | | ArgumentNullException.ThrowIfNull(x); |
| | 0 | 29 | | ArgumentNullException.ThrowIfNull(y); |
| | | 30 | | |
| | 0 | 31 | | return AlphanumericComparator.CompareValues(x.Studios.FirstOrDefault(), y.Studios.FirstOrDefault()); |
| | | 32 | | } |
| | | 33 | | } |
| | | 34 | | } |