mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	removed IsRecentlyPlayed option and fixed FileTime warnings
This commit is contained in:
		
							parent
							
								
									dbf6081a9b
								
							
						
					
					
						commit
						ad0ec70433
					
				@ -339,9 +339,6 @@ namespace MediaBrowser.Api.UserLibrary
 | 
				
			|||||||
                        return userdata != null && userdata.PlayCount > 0;
 | 
					                        return userdata != null && userdata.PlayCount > 0;
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                case ItemFilter.IsRecentlyPlayed:
 | 
					 | 
				
			||||||
                    return items.Where(item => item.IsRecentlyPlayed(user));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                case ItemFilter.IsUnplayed:
 | 
					                case ItemFilter.IsUnplayed:
 | 
				
			||||||
                    return items.Where(item =>
 | 
					                    return items.Where(item =>
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
 | 
				
			|||||||
@ -1004,29 +1004,6 @@ namespace MediaBrowser.Controller.Entities
 | 
				
			|||||||
            return (DateTime.UtcNow - DateCreated).TotalDays < ConfigurationManager.Configuration.RecentItemDays;
 | 
					            return (DateTime.UtcNow - DateCreated).TotalDays < ConfigurationManager.Configuration.RecentItemDays;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Determines if the item is considered recently played on user settings
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <param name="user">The user.</param>
 | 
					 | 
				
			||||||
        /// <returns><c>true</c> if [is recently played] [the specified user]; otherwise, <c>false</c>.</returns>
 | 
					 | 
				
			||||||
        /// <exception cref="System.ArgumentNullException"></exception>
 | 
					 | 
				
			||||||
        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;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Adds people to the item
 | 
					        /// Adds people to the item
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -19,8 +19,9 @@
 | 
				
			|||||||
**************************************************************************/
 | 
					**************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Text;
 | 
					 | 
				
			||||||
using System.Runtime.InteropServices;
 | 
					using System.Runtime.InteropServices;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MediaBrowser.Installer.Code
 | 
					namespace MediaBrowser.Installer.Code
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -47,7 +48,7 @@ namespace MediaBrowser.Installer.Code
 | 
				
			|||||||
    SLGP_RAWPATH = 0x4
 | 
					    SLGP_RAWPATH = 0x4
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  [StructLayoutAttribute(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
 | 
					  [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
 | 
				
			||||||
  public struct WIN32_FIND_DATAA
 | 
					  public struct WIN32_FIND_DATAA
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    public int dwFileAttributes;
 | 
					    public int dwFileAttributes;
 | 
				
			||||||
 | 
				
			|||||||
@ -224,13 +224,6 @@ namespace MediaBrowser.Model.Configuration
 | 
				
			|||||||
        [ProtoMember(34)]
 | 
					        [ProtoMember(34)]
 | 
				
			||||||
        public int RecentItemDays { get; set; }
 | 
					        public int RecentItemDays { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Gets or sets the recently played days.
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <value>The recently played days.</value>
 | 
					 | 
				
			||||||
        [ProtoMember(35)]
 | 
					 | 
				
			||||||
        public int RecentlyPlayedDays { get; set; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
 | 
					        /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
@ -291,7 +284,6 @@ namespace MediaBrowser.Model.Configuration
 | 
				
			|||||||
            FileWatcherDelay = 8;
 | 
					            FileWatcherDelay = 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            RecentItemDays = 14;
 | 
					            RecentItemDays = 14;
 | 
				
			||||||
            RecentlyPlayedDays = 14;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            EnableInternetProviders = true; //initial installs will need these
 | 
					            EnableInternetProviders = true; //initial installs will need these
 | 
				
			||||||
            InternetProviderExcludeTypes = new string[] { };
 | 
					            InternetProviderExcludeTypes = new string[] { };
 | 
				
			||||||
 | 
				
			|||||||
@ -33,10 +33,6 @@ namespace MediaBrowser.Model.Dto
 | 
				
			|||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// The item is resumable
 | 
					        /// The item is resumable
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        IsResumable = 7,
 | 
					        IsResumable = 7
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// The item is recently played
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        IsRecentlyPlayed = 8
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user