From bb031f553b940d21fa89f319d294745484c2234e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 8 May 2014 16:26:20 -0400 Subject: fix portable and 3.5 project references --- .../Sorting/IsPlayedComparer.cs | 58 ++++++++++++++++++++++ .../Sorting/IsUnplayedComparer.cs | 51 ------------------- 2 files changed, 58 insertions(+), 51 deletions(-) create mode 100644 MediaBrowser.Server.Implementations/Sorting/IsPlayedComparer.cs (limited to 'MediaBrowser.Server.Implementations/Sorting') diff --git a/MediaBrowser.Server.Implementations/Sorting/IsPlayedComparer.cs b/MediaBrowser.Server.Implementations/Sorting/IsPlayedComparer.cs new file mode 100644 index 000000000..aebfbdb1c --- /dev/null +++ b/MediaBrowser.Server.Implementations/Sorting/IsPlayedComparer.cs @@ -0,0 +1,58 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Sorting; +using MediaBrowser.Model.Querying; + +namespace MediaBrowser.Server.Implementations.Sorting +{ + public class IsPlayedComparer : IUserBaseItemComparer + { + /// + /// Gets or sets the user. + /// + /// The user. + public User User { get; set; } + + /// + /// Compares the specified x. + /// + /// The x. + /// The y. + /// System.Int32. + public int Compare(BaseItem x, BaseItem y) + { + return GetValue(x).CompareTo(GetValue(y)); + } + + /// + /// Gets the date. + /// + /// The x. + /// DateTime. + private int GetValue(BaseItem x) + { + return x.IsPlayed(User) ? 0 : 1; + } + + /// + /// Gets the name. + /// + /// The name. + public string Name + { + get { return ItemSortBy.IsUnplayed; } + } + + /// + /// Gets or sets the user data repository. + /// + /// The user data repository. + public IUserDataManager UserDataRepository { get; set; } + + /// + /// Gets or sets the user manager. + /// + /// The user manager. + public IUserManager UserManager { get; set; } + } +} \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Sorting/IsUnplayedComparer.cs b/MediaBrowser.Server.Implementations/Sorting/IsUnplayedComparer.cs index e3053155f..f1c6a5a4e 100644 --- a/MediaBrowser.Server.Implementations/Sorting/IsUnplayedComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/IsUnplayedComparer.cs @@ -55,55 +55,4 @@ namespace MediaBrowser.Server.Implementations.Sorting /// The user manager. public IUserManager UserManager { get; set; } } - - public class IsPlayedComparer : IUserBaseItemComparer - { - /// - /// Gets or sets the user. - /// - /// The user. - public User User { get; set; } - - /// - /// Compares the specified x. - /// - /// The x. - /// The y. - /// System.Int32. - public int Compare(BaseItem x, BaseItem y) - { - return GetValue(x).CompareTo(GetValue(y)); - } - - /// - /// Gets the date. - /// - /// The x. - /// DateTime. - private int GetValue(BaseItem x) - { - return x.IsPlayed(User) ? 0 : 1; - } - - /// - /// Gets the name. - /// - /// The name. - public string Name - { - get { return ItemSortBy.IsUnplayed; } - } - - /// - /// Gets or sets the user data repository. - /// - /// The user data repository. - public IUserDataManager UserDataRepository { get; set; } - - /// - /// Gets or sets the user manager. - /// - /// The user manager. - public IUserManager UserManager { get; set; } - } } -- cgit v1.2.3