mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
fixes #506 - Song list - make columns headers clickable for sorting
This commit is contained in:
33
MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
Normal file
33
MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Sorting;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Sorting
|
||||
{
|
||||
/// <summary>
|
||||
/// Class NameComparer
|
||||
/// </summary>
|
||||
public class NameComparer : IBaseItemComparer
|
||||
{
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
/// </summary>
|
||||
/// <param name="x">The x.</param>
|
||||
/// <param name="y">The y.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
public int Compare(BaseItem x, BaseItem y)
|
||||
{
|
||||
return string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get { return ItemSortBy.Name; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user