diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-25 23:47:46 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-25 23:47:46 -0400 |
| commit | 0246ea8a6369bfd57c7d67bbbb3fccd7c8f1cb38 (patch) | |
| tree | 0e03acf3de580329d3471d3cfcc50995e38af123 /MediaBrowser.Server.Implementations/LiveTv | |
| parent | 8e2d244749d7aaec08ff10149674bbb75833b130 (diff) | |
support head requests for images
Diffstat (limited to 'MediaBrowser.Server.Implementations/LiveTv')
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 562b97a48..64f7a3373 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -194,8 +194,33 @@ namespace MediaBrowser.Server.Implementations.LiveTv } } + var enableFavoriteSorting = query.EnableFavoriteSorting; + channels = channels.OrderBy(i => { + if (enableFavoriteSorting) + { + var userData = _userDataManager.GetUserData(user.Id, i.GetUserDataKey()); + + if (userData.IsFavorite) + { + return 0; + } + if (userData.Likes.HasValue) + { + if (!userData.Likes.Value) + { + return 3; + } + + return 1; + } + } + + return 2; + }) + .ThenBy(i => + { double number = 0; if (!string.IsNullOrEmpty(i.Number)) |
