diff --git a/MediaBrowser.Model/Querying/ItemSortBy.cs b/MediaBrowser.Model/Querying/ItemSortBy.cs
index deb0ce51d..f2c9ece32 100644
--- a/MediaBrowser.Model/Querying/ItemSortBy.cs
+++ b/MediaBrowser.Model/Querying/ItemSortBy.cs
@@ -82,5 +82,6 @@ namespace MediaBrowser.Model.Querying
public const string AlbumCount = "AlbumCount";
public const string MusicVideoCount = "MusicVideoCount";
public const string SeriesSortName = "SeriesSortName";
+ public const string VideoBitRate = "VideoBitRate";
}
}
diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
index 6be7487ad..fed6dad82 100644
--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
@@ -210,6 +210,7 @@
+
diff --git a/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs b/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs
index 33da4cec3..f8c8c4bce 100644
--- a/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/SeriesCountComparer.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Sorting;
diff --git a/MediaBrowser.Server.Implementations/Sorting/VideoBitRateComparer.cs b/MediaBrowser.Server.Implementations/Sorting/VideoBitRateComparer.cs
new file mode 100644
index 000000000..469eb5d6a
--- /dev/null
+++ b/MediaBrowser.Server.Implementations/Sorting/VideoBitRateComparer.cs
@@ -0,0 +1,49 @@
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Sorting;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Querying;
+using System.Linq;
+
+namespace MediaBrowser.Server.Implementations.Sorting
+{
+ class VideoBitRateComparer : IBaseItemComparer
+ {
+ ///
+ /// Compares the specified x.
+ ///
+ /// The x.
+ /// The y.
+ /// System.Int32.
+ public int Compare(BaseItem x, BaseItem y)
+ {
+ return GetValue(x).CompareTo(GetValue(y));
+ }
+
+ private int GetValue(BaseItem item)
+ {
+ var video = item as IHasMediaStreams;
+
+ if (video != null)
+ {
+ var videoStream = video.MediaStreams
+ .FirstOrDefault(i => i.Type == MediaStreamType.Video);
+
+ if (videoStream != null)
+ {
+ return videoStream.BitRate ?? 0;
+ }
+ }
+
+ return 0;
+ }
+
+ ///
+ /// Gets the name.
+ ///
+ /// The name.
+ public string Name
+ {
+ get { return ItemSortBy.VideoBitRate; }
+ }
+ }
+}