mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-11 09:13:54 -04:00
fix SA1111
This commit is contained in:
parent
9b528aabc2
commit
afc9224ede
@ -102,20 +102,15 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
return new SessionInfo[] { from };
|
return new SessionInfo[] { from };
|
||||||
case BroadcastType.AllGroup:
|
case BroadcastType.AllGroup:
|
||||||
return _group.Participants.Values.Select(
|
return _group.Participants.Values.Select(
|
||||||
session => session.Session
|
session => session.Session).ToArray();
|
||||||
).ToArray();
|
|
||||||
case BroadcastType.AllExceptCurrentSession:
|
case BroadcastType.AllExceptCurrentSession:
|
||||||
return _group.Participants.Values.Select(
|
return _group.Participants.Values.Select(
|
||||||
session => session.Session
|
session => session.Session).Where(
|
||||||
).Where(
|
session => !session.Id.Equals(from.Id)).ToArray();
|
||||||
session => !session.Id.Equals(from.Id)
|
|
||||||
).ToArray();
|
|
||||||
case BroadcastType.AllReady:
|
case BroadcastType.AllReady:
|
||||||
return _group.Participants.Values.Where(
|
return _group.Participants.Values.Where(
|
||||||
session => !session.IsBuffering
|
session => !session.IsBuffering).Select(
|
||||||
).Select(
|
session => session.Session).ToArray();
|
||||||
session => session.Session
|
|
||||||
).ToArray();
|
|
||||||
default:
|
default:
|
||||||
return Array.Empty<SessionInfo>();
|
return Array.Empty<SessionInfo>();
|
||||||
}
|
}
|
||||||
@ -314,8 +309,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
// Playback synchronization will mainly happen client side
|
// Playback synchronization will mainly happen client side
|
||||||
_group.IsPaused = false;
|
_group.IsPaused = false;
|
||||||
_group.LastActivity = DateTime.UtcNow.AddMilliseconds(
|
_group.LastActivity = DateTime.UtcNow.AddMilliseconds(
|
||||||
delay
|
delay);
|
||||||
);
|
|
||||||
|
|
||||||
var command = NewSyncPlayCommand(SendCommandType.Play);
|
var command = NewSyncPlayCommand(SendCommandType.Play);
|
||||||
SendCommand(session, BroadcastType.AllGroup, command, cancellationToken);
|
SendCommand(session, BroadcastType.AllGroup, command, cancellationToken);
|
||||||
@ -449,8 +443,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
{
|
{
|
||||||
// Client that was buffering is recovering, notifying others to resume
|
// Client that was buffering is recovering, notifying others to resume
|
||||||
_group.LastActivity = currentTime.AddMilliseconds(
|
_group.LastActivity = currentTime.AddMilliseconds(
|
||||||
delay
|
delay);
|
||||||
);
|
|
||||||
var command = NewSyncPlayCommand(SendCommandType.Play);
|
var command = NewSyncPlayCommand(SendCommandType.Play);
|
||||||
SendCommand(session, BroadcastType.AllExceptCurrentSession, command, cancellationToken);
|
SendCommand(session, BroadcastType.AllExceptCurrentSession, command, cancellationToken);
|
||||||
}
|
}
|
||||||
@ -461,8 +454,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
delay = delay < _group.DefaulPing ? _group.DefaulPing : delay;
|
delay = delay < _group.DefaulPing ? _group.DefaulPing : delay;
|
||||||
|
|
||||||
_group.LastActivity = currentTime.AddMilliseconds(
|
_group.LastActivity = currentTime.AddMilliseconds(
|
||||||
delay
|
delay);
|
||||||
);
|
|
||||||
|
|
||||||
var command = NewSyncPlayCommand(SendCommandType.Play);
|
var command = NewSyncPlayCommand(SendCommandType.Play);
|
||||||
SendCommand(session, BroadcastType.AllGroup, command, cancellationToken);
|
SendCommand(session, BroadcastType.AllGroup, command, cancellationToken);
|
||||||
|
@ -297,19 +297,15 @@ namespace Emby.Server.Implementations.SyncPlay
|
|||||||
if (!filterItemId.Equals(Guid.Empty))
|
if (!filterItemId.Equals(Guid.Empty))
|
||||||
{
|
{
|
||||||
return _groups.Values.Where(
|
return _groups.Values.Where(
|
||||||
group => group.GetPlayingItemId().Equals(filterItemId) && HasAccessToItem(user, group.GetPlayingItemId())
|
group => group.GetPlayingItemId().Equals(filterItemId) && HasAccessToItem(user, group.GetPlayingItemId())).Select(
|
||||||
).Select(
|
group => group.GetInfo()).ToList();
|
||||||
group => group.GetInfo()
|
|
||||||
).ToList();
|
|
||||||
}
|
}
|
||||||
// Otherwise show all available groups
|
// Otherwise show all available groups
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return _groups.Values.Where(
|
return _groups.Values.Where(
|
||||||
group => HasAccessToItem(user, group.GetPlayingItemId())
|
group => HasAccessToItem(user, group.GetPlayingItemId())).Select(
|
||||||
).Select(
|
group => group.GetInfo()).ToList();
|
||||||
group => group.GetInfo()
|
|
||||||
).ToList();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1245,8 +1245,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
// Support plex/xbmc convention
|
// Support plex/xbmc convention
|
||||||
files.AddRange(fileSystemChildren
|
files.AddRange(fileSystemChildren
|
||||||
.Where(i => !i.IsDirectory && string.Equals(FileSystem.GetFileNameWithoutExtension(i), ThemeSongFilename, StringComparison.OrdinalIgnoreCase))
|
.Where(i => !i.IsDirectory && string.Equals(FileSystem.GetFileNameWithoutExtension(i), ThemeSongFilename, StringComparison.OrdinalIgnoreCase)));
|
||||||
);
|
|
||||||
|
|
||||||
return LibraryManager.ResolvePaths(files, directoryService, null, new LibraryOptions())
|
return LibraryManager.ResolvePaths(files, directoryService, null, new LibraryOptions())
|
||||||
.OfType<Audio.Audio>()
|
.OfType<Audio.Audio>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user