mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
@@ -373,7 +373,7 @@ namespace Emby.Server.Implementations.Session
|
||||
info.MediaSourceId = info.ItemId.ToString("N", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
if (!info.ItemId.Equals(Guid.Empty) && info.Item == null && libraryItem != null)
|
||||
if (!info.ItemId.Equals(default) && info.Item == null && libraryItem != null)
|
||||
{
|
||||
var current = session.NowPlayingItem;
|
||||
|
||||
@@ -558,22 +558,24 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
var users = new List<User>();
|
||||
|
||||
if (session.UserId != Guid.Empty)
|
||||
if (session.UserId.Equals(default))
|
||||
{
|
||||
var user = _userManager.GetUserById(session.UserId);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new InvalidOperationException("User not found");
|
||||
}
|
||||
|
||||
users.Add(user);
|
||||
|
||||
users.AddRange(session.AdditionalUsers
|
||||
.Select(i => _userManager.GetUserById(i.UserId))
|
||||
.Where(i => i != null));
|
||||
return users;
|
||||
}
|
||||
|
||||
var user = _userManager.GetUserById(session.UserId);
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
throw new InvalidOperationException("User not found");
|
||||
}
|
||||
|
||||
users.Add(user);
|
||||
|
||||
users.AddRange(session.AdditionalUsers
|
||||
.Select(i => _userManager.GetUserById(i.UserId))
|
||||
.Where(i => i != null));
|
||||
|
||||
return users;
|
||||
}
|
||||
|
||||
@@ -665,7 +667,7 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
var session = GetSession(info.SessionId);
|
||||
|
||||
var libraryItem = info.ItemId == Guid.Empty
|
||||
var libraryItem = info.ItemId.Equals(default)
|
||||
? null
|
||||
: GetNowPlayingItem(session, info.ItemId);
|
||||
|
||||
@@ -760,7 +762,7 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
var session = GetSession(info.SessionId);
|
||||
|
||||
var libraryItem = info.ItemId.Equals(Guid.Empty)
|
||||
var libraryItem = info.ItemId.Equals(default)
|
||||
? null
|
||||
: GetNowPlayingItem(session, info.ItemId);
|
||||
|
||||
@@ -897,7 +899,7 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
session.StopAutomaticProgress();
|
||||
|
||||
var libraryItem = info.ItemId.Equals(Guid.Empty)
|
||||
var libraryItem = info.ItemId.Equals(default)
|
||||
? null
|
||||
: GetNowPlayingItem(session, info.ItemId);
|
||||
|
||||
@@ -907,7 +909,7 @@ namespace Emby.Server.Implementations.Session
|
||||
info.MediaSourceId = info.ItemId.ToString("N", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
if (!info.ItemId.Equals(Guid.Empty) && info.Item == null && libraryItem != null)
|
||||
if (!info.ItemId.Equals(default) && info.Item == null && libraryItem != null)
|
||||
{
|
||||
var current = session.NowPlayingItem;
|
||||
|
||||
@@ -1127,7 +1129,7 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
var session = GetSessionToRemoteControl(sessionId);
|
||||
|
||||
var user = session.UserId == Guid.Empty ? null : _userManager.GetUserById(session.UserId);
|
||||
var user = session.UserId.Equals(default) ? null : _userManager.GetUserById(session.UserId);
|
||||
|
||||
List<BaseItem> items;
|
||||
|
||||
@@ -1182,7 +1184,7 @@ namespace Emby.Server.Implementations.Session
|
||||
EnableImages = false
|
||||
})
|
||||
.Where(i => !i.IsVirtualItem)
|
||||
.SkipWhile(i => i.Id != episode.Id)
|
||||
.SkipWhile(i => !i.Id.Equals(episode.Id))
|
||||
.ToList();
|
||||
|
||||
if (episodes.Count > 0)
|
||||
@@ -1196,7 +1198,7 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
var controllingSession = GetSession(controllingSessionId);
|
||||
AssertCanControl(session, controllingSession);
|
||||
if (!controllingSession.UserId.Equals(Guid.Empty))
|
||||
if (!controllingSession.UserId.Equals(default))
|
||||
{
|
||||
command.ControllingUserId = controllingSession.UserId;
|
||||
}
|
||||
@@ -1315,7 +1317,7 @@ namespace Emby.Server.Implementations.Session
|
||||
{
|
||||
var controllingSession = GetSession(controllingSessionId);
|
||||
AssertCanControl(session, controllingSession);
|
||||
if (!controllingSession.UserId.Equals(Guid.Empty))
|
||||
if (!controllingSession.UserId.Equals(default))
|
||||
{
|
||||
command.ControllingUserId = controllingSession.UserId.ToString("N", CultureInfo.InvariantCulture);
|
||||
}
|
||||
@@ -1388,12 +1390,12 @@ namespace Emby.Server.Implementations.Session
|
||||
|
||||
var session = GetSession(sessionId);
|
||||
|
||||
if (session.UserId == userId)
|
||||
if (session.UserId.Equals(userId))
|
||||
{
|
||||
throw new ArgumentException("The requested user is already the primary user of the session.");
|
||||
}
|
||||
|
||||
if (session.AdditionalUsers.All(i => i.UserId != userId))
|
||||
if (session.AdditionalUsers.All(i => !i.UserId.Equals(userId)))
|
||||
{
|
||||
var user = _userManager.GetUserById(userId);
|
||||
|
||||
@@ -1463,7 +1465,7 @@ namespace Emby.Server.Implementations.Session
|
||||
CheckDisposed();
|
||||
|
||||
User user = null;
|
||||
if (request.UserId != Guid.Empty)
|
||||
if (!request.UserId.Equals(default))
|
||||
{
|
||||
user = _userManager.GetUserById(request.UserId);
|
||||
}
|
||||
@@ -1792,7 +1794,7 @@ namespace Emby.Server.Implementations.Session
|
||||
throw new ArgumentNullException(nameof(info));
|
||||
}
|
||||
|
||||
var user = info.UserId == Guid.Empty
|
||||
var user = info.UserId.Equals(default)
|
||||
? null
|
||||
: _userManager.GetUserById(info.UserId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user