diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-08 13:17:05 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-08 13:17:05 -0500 |
| commit | 1ead63b0d1a532cf828a4ed7c5310eef9c255740 (patch) | |
| tree | b272e8e09b9e2cb78eb8c641238c3d75bbb08da0 /MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs | |
| parent | 83042f0d1310a0b6ecf0882b6c8027eca9e24c77 (diff) | |
add column sorting to reports
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs b/MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs new file mode 100644 index 000000000..83ab4dfc2 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Sorting/StudioComparer.cs @@ -0,0 +1,30 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Sorting; +using MediaBrowser.Model.Querying; +using System.Linq; + +namespace MediaBrowser.Server.Implementations.Sorting +{ + public class StudioComparer : 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 AlphanumComparator.CompareValues(x.Studios.FirstOrDefault() ?? string.Empty, y.Studios.FirstOrDefault() ?? string.Empty); + } + + /// <summary> + /// Gets the name. + /// </summary> + /// <value>The name.</value> + public string Name + { + get { return ItemSortBy.Studio; } + } + } +} |
