From ad0ec704331474dee41524f52ab7d0d88ca556a4 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Fri, 8 Mar 2013 11:45:35 -0500 Subject: [PATCH] removed IsRecentlyPlayed option and fixed FileTime warnings --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 3 --- MediaBrowser.Controller/Entities/BaseItem.cs | 23 ------------------- .../Code/ShellLinkNative.cs | 5 ++-- .../Configuration/ServerConfiguration.cs | 8 ------- MediaBrowser.Model/DTO/ItemFilter.cs | 6 +---- 5 files changed, 4 insertions(+), 41 deletions(-) diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 86c5169f26..951a63b4e2 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -339,9 +339,6 @@ namespace MediaBrowser.Api.UserLibrary return userdata != null && userdata.PlayCount > 0; }); - case ItemFilter.IsRecentlyPlayed: - return items.Where(item => item.IsRecentlyPlayed(user)); - case ItemFilter.IsUnplayed: return items.Where(item => { diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index f90044d8b0..cc3ec5c2ae 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1004,29 +1004,6 @@ namespace MediaBrowser.Controller.Entities return (DateTime.UtcNow - DateCreated).TotalDays < ConfigurationManager.Configuration.RecentItemDays; } - /// - /// Determines if the item is considered recently played on user settings - /// - /// The user. - /// true if [is recently played] [the specified user]; otherwise, false. - /// - public bool IsRecentlyPlayed(User user) - { - if (user == null) - { - throw new ArgumentNullException(); - } - - var data = GetUserData(user, false); - - if (data == null || data.LastPlayedDate == null || data.PlayCount == 0) - { - return false; - } - - return (DateTime.UtcNow - data.LastPlayedDate.Value).TotalDays < ConfigurationManager.Configuration.RecentlyPlayedDays; - } - /// /// Adds people to the item /// diff --git a/MediaBrowser.Installer/Code/ShellLinkNative.cs b/MediaBrowser.Installer/Code/ShellLinkNative.cs index 20e0bc6c3d..d603fe3a5d 100644 --- a/MediaBrowser.Installer/Code/ShellLinkNative.cs +++ b/MediaBrowser.Installer/Code/ShellLinkNative.cs @@ -19,8 +19,9 @@ **************************************************************************/ using System; -using System.Text; using System.Runtime.InteropServices; +using System.Text; +using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; namespace MediaBrowser.Installer.Code { @@ -47,7 +48,7 @@ namespace MediaBrowser.Installer.Code SLGP_RAWPATH = 0x4 } - [StructLayoutAttribute(LayoutKind.Sequential, CharSet=CharSet.Ansi)] + [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] public struct WIN32_FIND_DATAA { public int dwFileAttributes; diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 0ddafe19a5..8e0425447d 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -224,13 +224,6 @@ namespace MediaBrowser.Model.Configuration [ProtoMember(34)] public int RecentItemDays { get; set; } - /// - /// Gets or sets the recently played days. - /// - /// The recently played days. - [ProtoMember(35)] - public int RecentlyPlayedDays { get; set; } - /// /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated. /// @@ -291,7 +284,6 @@ namespace MediaBrowser.Model.Configuration FileWatcherDelay = 8; RecentItemDays = 14; - RecentlyPlayedDays = 14; EnableInternetProviders = true; //initial installs will need these InternetProviderExcludeTypes = new string[] { }; diff --git a/MediaBrowser.Model/DTO/ItemFilter.cs b/MediaBrowser.Model/DTO/ItemFilter.cs index cdf3900201..038acc5874 100644 --- a/MediaBrowser.Model/DTO/ItemFilter.cs +++ b/MediaBrowser.Model/DTO/ItemFilter.cs @@ -33,10 +33,6 @@ namespace MediaBrowser.Model.Dto /// /// The item is resumable /// - IsResumable = 7, - /// - /// The item is recently played - /// - IsRecentlyPlayed = 8 + IsResumable = 7 } }