mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	Merge pull request #10649 from felix920506/issue-10610
Make "activeWithinSeconds" independent from "controllableByUserId" parameter
This commit is contained in:
		
						commit
						7ebb4d3b24
					
				@ -91,12 +91,6 @@ public class SessionController : BaseJellyfinApiController
 | 
				
			|||||||
                result = result.Where(i => !i.UserId.Equals(default));
 | 
					                result = result.Where(i => !i.UserId.Equals(default));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (activeWithinSeconds.HasValue && activeWithinSeconds.Value > 0)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                var minActiveDate = DateTime.UtcNow.AddSeconds(0 - activeWithinSeconds.Value);
 | 
					 | 
				
			||||||
                result = result.Where(i => i.LastActivityDate >= minActiveDate);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            result = result.Where(i =>
 | 
					            result = result.Where(i =>
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (!string.IsNullOrWhiteSpace(i.DeviceId))
 | 
					                if (!string.IsNullOrWhiteSpace(i.DeviceId))
 | 
				
			||||||
@ -111,6 +105,12 @@ public class SessionController : BaseJellyfinApiController
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (activeWithinSeconds.HasValue && activeWithinSeconds.Value > 0)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var minActiveDate = DateTime.UtcNow.AddSeconds(0 - activeWithinSeconds.Value);
 | 
				
			||||||
 | 
					            result = result.Where(i => i.LastActivityDate >= minActiveDate);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return Ok(result);
 | 
					        return Ok(result);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user