mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 13:28:27 +01:00
Hide some property setters, init null values, update namespaces
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
||||
{
|
||||
/// <summary>
|
||||
/// Class AbstractGroupState.
|
||||
@@ -104,7 +104,11 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
return;
|
||||
}
|
||||
|
||||
var reason = request.Mode.Equals("next", StringComparison.OrdinalIgnoreCase) ? PlayQueueUpdateReason.QueueNext : PlayQueueUpdateReason.Queue;
|
||||
var reason = request.Mode switch
|
||||
{
|
||||
GroupQueueMode.QueueNext => PlayQueueUpdateReason.QueueNext,
|
||||
_ => PlayQueueUpdateReason.Queue
|
||||
};
|
||||
var playQueueUpdate = context.GetPlayQueueUpdate(reason);
|
||||
var update = context.NewSyncPlayGroupUpdate(GroupUpdateType.PlayQueue, playQueueUpdate);
|
||||
context.SendGroupUpdate(session, SyncPlayBroadcastType.AllGroup, update, cancellationToken);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
||||
{
|
||||
/// <summary>
|
||||
/// Class IdleGroupState.
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PausedGroupState.
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PlayingGroupState.
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.GroupStates
|
||||
{
|
||||
/// <summary>
|
||||
/// Class WaitingGroupState.
|
||||
@@ -464,8 +465,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
{
|
||||
// Others are still buffering, tell this client to pause when ready.
|
||||
var command = context.NewSyncPlayCommand(SendCommandType.Pause);
|
||||
var pauseAtTime = currentTime.AddTicks(delayTicks);
|
||||
command.When = context.DateToUTCString(pauseAtTime);
|
||||
command.When = currentTime.AddTicks(delayTicks);
|
||||
context.SendCommand(session, SyncPlayBroadcastType.CurrentSession, command, cancellationToken);
|
||||
|
||||
Logger.LogInformation("HandleRequest: {0} in group {1}, others still buffering, {2} will pause when ready in {3} seconds.", request.Type, context.GroupId.ToString(), session.Id, TimeSpan.FromTicks(delayTicks).TotalSeconds);
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Threading;
|
||||
using Jellyfin.Data.Entities;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.Queue;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.PlaybackRequests;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Controller.SyncPlay.Queue;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
@@ -97,13 +98,6 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
/// <returns>The group update.</returns>
|
||||
GroupUpdate<T> NewSyncPlayGroupUpdate<T>(GroupUpdateType type, T data);
|
||||
|
||||
/// <summary>
|
||||
/// Converts DateTime to UTC string.
|
||||
/// </summary>
|
||||
/// <param name="dateTime">The date to convert.</param>
|
||||
/// <returns>The UTC string.</returns>
|
||||
string DateToUTCString(DateTime dateTime);
|
||||
|
||||
/// <summary>
|
||||
/// Sanitizes the PositionTicks, considers the current playing item when available.
|
||||
/// </summary>
|
||||
@@ -187,7 +181,7 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
/// <param name="newItems">The new items to add to the play queue.</param>
|
||||
/// <param name="mode">The mode with which the items will be added.</param>
|
||||
/// <returns><c>true</c> if the play queue has been changed; <c>false</c> if something went wrong.</returns>
|
||||
bool AddToPlayQueue(IEnumerable<Guid> newItems, string mode);
|
||||
bool AddToPlayQueue(IEnumerable<Guid> newItems, GroupQueueMode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Restarts current item in play queue.
|
||||
@@ -210,13 +204,13 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
/// Sets the repeat mode.
|
||||
/// </summary>
|
||||
/// <param name="mode">The new mode.</param>
|
||||
void SetRepeatMode(string mode);
|
||||
void SetRepeatMode(GroupRepeatMode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the shuffle mode.
|
||||
/// </summary>
|
||||
/// <param name="mode">The new mode.</param>
|
||||
void SetShuffleMode(string mode);
|
||||
void SetShuffleMode(GroupShuffleMode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a play queue update.
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class BufferGroupRequest.
|
||||
@@ -11,28 +11,43 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class BufferGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets when the request has been made by the client.
|
||||
/// Initializes a new instance of the <see cref="BufferGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="when">When the request has been made, as reported by the client.</param>
|
||||
/// <param name="positionTicks">The position ticks.</param>
|
||||
/// <param name="isPlaying">Whether the client playback is unpaused.</param>
|
||||
/// <param name="playlistItemId">The playlist item identifier of the playing item.</param>
|
||||
public BufferGroupRequest(DateTime when, long positionTicks, bool isPlaying, string playlistItemId)
|
||||
{
|
||||
When = when;
|
||||
PositionTicks = positionTicks;
|
||||
IsPlaying = isPlaying;
|
||||
PlaylistItemId = playlistItemId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets when the request has been made by the client.
|
||||
/// </summary>
|
||||
/// <value>The date of the request.</value>
|
||||
public DateTime When { get; set; }
|
||||
public DateTime When { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// Gets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long PositionTicks { get; set; }
|
||||
public long PositionTicks { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the client playback is unpaused.
|
||||
/// Gets a value indicating whether the client playback is unpaused.
|
||||
/// </summary>
|
||||
/// <value>The client playback status.</value>
|
||||
public bool IsPlaying { get; set; }
|
||||
public bool IsPlaying { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playlist item identifier of the playing item.
|
||||
/// Gets the playlist item identifier of the playing item.
|
||||
/// </summary>
|
||||
/// <value>The playlist item identifier.</value>
|
||||
public string PlaylistItemId { get; set; }
|
||||
public string PlaylistItemId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.Buffer;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class IgnoreWaitGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class IgnoreWaitGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the client should be ignored.
|
||||
/// Initializes a new instance of the <see cref="IgnoreWaitGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="ignoreWait">Whether the client should be ignored.</param>
|
||||
public IgnoreWaitGroupRequest(bool ignoreWait)
|
||||
{
|
||||
IgnoreWait = ignoreWait;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the client should be ignored.
|
||||
/// </summary>
|
||||
/// <value>The client group-wait status.</value>
|
||||
public bool IgnoreWait { get; set; }
|
||||
public bool IgnoreWait { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.IgnoreWait;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class MovePlaylistItemGroupRequest.
|
||||
@@ -10,16 +10,27 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class MovePlaylistItemGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the playlist identifier of the item.
|
||||
/// Initializes a new instance of the <see cref="MovePlaylistItemGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <value>The playlist identifier of the item.</value>
|
||||
public string PlaylistItemId { get; set; }
|
||||
/// <param name="playlistItemId">The playlist identifier of the item.</param>
|
||||
/// <param name="newIndex">The new position.</param>
|
||||
public MovePlaylistItemGroupRequest(string playlistItemId, int newIndex)
|
||||
{
|
||||
PlaylistItemId = playlistItemId;
|
||||
NewIndex = newIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the new position.
|
||||
/// Gets the playlist identifier of the item.
|
||||
/// </summary>
|
||||
/// <value>The playlist identifier of the item.</value>
|
||||
public string PlaylistItemId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the new position.
|
||||
/// </summary>
|
||||
/// <value>The new position.</value>
|
||||
public int NewIndex { get; set; }
|
||||
public int NewIndex { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.MovePlaylistItem;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class NextTrackGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class NextTrackGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item identifier.
|
||||
/// Initializes a new instance of the <see cref="NextTrackGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="playlistItemId">The playing item identifier.</param>
|
||||
public NextTrackGroupRequest(string playlistItemId)
|
||||
{
|
||||
PlaylistItemId = playlistItemId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playing item identifier.
|
||||
/// </summary>
|
||||
/// <value>The playing item identifier.</value>
|
||||
public string PlaylistItemId { get; set; }
|
||||
public string PlaylistItemId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.NextTrack;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PauseGroupRequest.
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PingGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class PingGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the ping time.
|
||||
/// Initializes a new instance of the <see cref="PingGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="ping">The ping time.</param>
|
||||
public PingGroupRequest(long ping)
|
||||
{
|
||||
Ping = ping;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ping time.
|
||||
/// </summary>
|
||||
/// <value>The ping time.</value>
|
||||
public long Ping { get; set; }
|
||||
public long Ping { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.Ping;
|
||||
|
||||
@@ -4,30 +4,45 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PlayGroupRequest.
|
||||
/// </summary>
|
||||
public class PlayGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="playingQueue">The playing queue.</param>
|
||||
/// <param name="playingItemPosition">The playing item position.</param>
|
||||
/// <param name="startPositionTicks">The start position ticks.</param>
|
||||
public PlayGroupRequest(Guid[] playingQueue, int playingItemPosition, long startPositionTicks)
|
||||
{
|
||||
var list = new List<Guid>();
|
||||
list.AddRange(playingQueue);
|
||||
PlayingQueue = list;
|
||||
PlayingItemPosition = playingItemPosition;
|
||||
StartPositionTicks = startPositionTicks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playing queue.
|
||||
/// </summary>
|
||||
/// <value>The playing queue.</value>
|
||||
public List<Guid> PlayingQueue { get; } = new List<Guid>();
|
||||
public IReadOnlyList<Guid> PlayingQueue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item from the queue.
|
||||
/// Gets the position of the playing item in the queue.
|
||||
/// </summary>
|
||||
/// <value>The playing item.</value>
|
||||
public int PlayingItemPosition { get; set; }
|
||||
/// <value>The playing item position.</value>
|
||||
public int PlayingItemPosition { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the start position ticks.
|
||||
/// Gets the start position ticks.
|
||||
/// </summary>
|
||||
/// <value>The start position ticks.</value>
|
||||
public long StartPositionTicks { get; set; }
|
||||
public long StartPositionTicks { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.Play;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PreviousTrackGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class PreviousTrackGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the playing item identifier.
|
||||
/// Initializes a new instance of the <see cref="PreviousTrackGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="playlistItemId">The playing item identifier.</param>
|
||||
public PreviousTrackGroupRequest(string playlistItemId)
|
||||
{
|
||||
PlaylistItemId = playlistItemId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playing item identifier.
|
||||
/// </summary>
|
||||
/// <value>The playing item identifier.</value>
|
||||
public string PlaylistItemId { get; set; }
|
||||
public string PlaylistItemId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.PreviousTrack;
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class QueueGroupRequest.
|
||||
@@ -12,16 +12,29 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class QueueGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the items to queue.
|
||||
/// Initializes a new instance of the <see cref="QueueGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <value>The items to queue.</value>
|
||||
public List<Guid> ItemIds { get; } = new List<Guid>();
|
||||
/// <param name="items">The items to add to the queue.</param>
|
||||
/// <param name="mode">The enqueue mode.</param>
|
||||
public QueueGroupRequest(Guid[] items, GroupQueueMode mode)
|
||||
{
|
||||
var list = new List<Guid>();
|
||||
list.AddRange(items);
|
||||
ItemIds = list;
|
||||
Mode = mode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mode in which to add the new items.
|
||||
/// Gets the items to enqueue.
|
||||
/// </summary>
|
||||
/// <value>The mode.</value>
|
||||
public string Mode { get; set; }
|
||||
/// <value>The items to enqueue.</value>
|
||||
public IReadOnlyList<Guid> ItemIds { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the mode in which to add the new items.
|
||||
/// </summary>
|
||||
/// <value>The enqueue mode.</value>
|
||||
public GroupQueueMode Mode { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.Queue;
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class ReadyGroupRequest.
|
||||
@@ -11,28 +11,43 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class ReadyGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets when the request has been made by the client.
|
||||
/// Initializes a new instance of the <see cref="ReadyGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="when">When the request has been made, as reported by the client.</param>
|
||||
/// <param name="positionTicks">The position ticks.</param>
|
||||
/// <param name="isPlaying">Whether the client playback is unpaused.</param>
|
||||
/// <param name="playlistItemId">The playlist item identifier of the playing item.</param>
|
||||
public ReadyGroupRequest(DateTime when, long positionTicks, bool isPlaying, string playlistItemId)
|
||||
{
|
||||
When = when;
|
||||
PositionTicks = positionTicks;
|
||||
IsPlaying = isPlaying;
|
||||
PlaylistItemId = playlistItemId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets when the request has been made by the client.
|
||||
/// </summary>
|
||||
/// <value>The date of the request.</value>
|
||||
public DateTime When { get; set; }
|
||||
public DateTime When { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// Gets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long PositionTicks { get; set; }
|
||||
public long PositionTicks { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the client playback is unpaused.
|
||||
/// Gets a value indicating whether the client playback is unpaused.
|
||||
/// </summary>
|
||||
/// <value>The client playback status.</value>
|
||||
public bool IsPlaying { get; set; }
|
||||
public bool IsPlaying { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the playlist item identifier of the playing item.
|
||||
/// Gets the playlist item identifier of the playing item.
|
||||
/// </summary>
|
||||
/// <value>The playlist item identifier.</value>
|
||||
public string PlaylistItemId { get; set; }
|
||||
public string PlaylistItemId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.Ready;
|
||||
|
||||
@@ -3,18 +3,29 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class RemoveFromPlaylistGroupRequest.
|
||||
/// </summary>
|
||||
public class RemoveFromPlaylistGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RemoveFromPlaylistGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="items">The playlist ids of the items to remove.</param>
|
||||
public RemoveFromPlaylistGroupRequest(string[] items)
|
||||
{
|
||||
var list = new List<string>();
|
||||
list.AddRange(items);
|
||||
PlaylistItemIds = list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playlist identifiers ot the items.
|
||||
/// </summary>
|
||||
/// <value>The playlist identifiers ot the items.</value>
|
||||
public List<string> PlaylistItemIds { get; } = new List<string>();
|
||||
public IReadOnlyList<string> PlaylistItemIds { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.RemoveFromPlaylist;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SeekGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class SeekGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the position ticks.
|
||||
/// Initializes a new instance of the <see cref="SeekGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="positionTicks">The position ticks.</param>
|
||||
public SeekGroupRequest(long positionTicks)
|
||||
{
|
||||
PositionTicks = positionTicks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position ticks.
|
||||
/// </summary>
|
||||
/// <value>The position ticks.</value>
|
||||
public long PositionTicks { get; set; }
|
||||
public long PositionTicks { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.Seek;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SetPlaylistItemGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class SetPlaylistItemGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the playlist identifier of the playing item.
|
||||
/// Initializes a new instance of the <see cref="SetPlaylistItemGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="playlistItemId">The playlist identifier of the item.</param>
|
||||
public SetPlaylistItemGroupRequest(string playlistItemId)
|
||||
{
|
||||
PlaylistItemId = playlistItemId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playlist identifier of the playing item.
|
||||
/// </summary>
|
||||
/// <value>The playlist identifier of the playing item.</value>
|
||||
public string PlaylistItemId { get; set; }
|
||||
public string PlaylistItemId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.SetPlaylistItem;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SetRepeatModeGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class SetRepeatModeGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the repeat mode.
|
||||
/// Initializes a new instance of the <see cref="SetRepeatModeGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="mode">The repeat mode.</param>
|
||||
public SetRepeatModeGroupRequest(GroupRepeatMode mode)
|
||||
{
|
||||
Mode = mode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the repeat mode.
|
||||
/// </summary>
|
||||
/// <value>The repeat mode.</value>
|
||||
public string Mode { get; set; }
|
||||
public GroupRepeatMode Mode { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.SetRepeatMode;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class SetShuffleModeGroupRequest.
|
||||
@@ -10,10 +10,19 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
public class SetShuffleModeGroupRequest : IGroupPlaybackRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the shuffle mode.
|
||||
/// Initializes a new instance of the <see cref="SetShuffleModeGroupRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="mode">The shuffle mode.</param>
|
||||
public SetShuffleModeGroupRequest(GroupShuffleMode mode)
|
||||
{
|
||||
Mode = mode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the shuffle mode.
|
||||
/// </summary>
|
||||
/// <value>The shuffle mode.</value>
|
||||
public string Mode { get; set; }
|
||||
public GroupShuffleMode Mode { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PlaybackRequestType Type { get; } = PlaybackRequestType.SetShuffleMode;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class StopGroupRequest.
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Threading;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UnpauseGroupRequest.
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.SyncPlay
|
||||
namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
{
|
||||
/// <summary>
|
||||
/// Class PlayQueueManager.
|
||||
@@ -563,11 +563,8 @@ namespace MediaBrowser.Controller.SyncPlay
|
||||
var list = new List<QueueItem>();
|
||||
foreach (var item in items)
|
||||
{
|
||||
list.Add(new QueueItem()
|
||||
{
|
||||
ItemId = item,
|
||||
PlaylistItemId = "syncPlayItem" + GetNextProgressiveId()
|
||||
});
|
||||
var queueItem = new QueueItem(item, "syncPlayItem" + GetNextProgressiveId());
|
||||
list.Add(queueItem);
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
Reference in New Issue
Block a user