diff options
| author | Ionut Andrei Oanca <oancaionutandrei@gmail.com> | 2020-11-14 23:40:01 +0100 |
|---|---|---|
| committer | Ionut Andrei Oanca <oancaionutandrei@gmail.com> | 2020-11-14 23:40:01 +0100 |
| commit | 5d77f422f0e4998130f1defebd08e053188a1a25 (patch) | |
| tree | b2c09449450ae6a6160c38195f21c91f8e9a20dd /MediaBrowser.Model | |
| parent | fa69f6fd511b88f2c10f37c45e1924b8bfe2e7ec (diff) | |
Hide some property setters, init null values, update namespaces
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/GroupInfoDto.cs | 15 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/GroupQueueMode.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/GroupRequestType.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/GroupStateType.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/NewGroupRequest.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/QueueItem.cs | 21 | ||||
| -rw-r--r-- | MediaBrowser.Model/SyncPlay/SendCommand.cs | 15 |
9 files changed, 86 insertions, 28 deletions
diff --git a/MediaBrowser.Model/SyncPlay/GroupInfoDto.cs b/MediaBrowser.Model/SyncPlay/GroupInfoDto.cs index 85b9a3522..16a75eb68 100644 --- a/MediaBrowser.Model/SyncPlay/GroupInfoDto.cs +++ b/MediaBrowser.Model/SyncPlay/GroupInfoDto.cs @@ -1,5 +1,4 @@ -#nullable disable - +using System; using System.Collections.Generic; namespace MediaBrowser.Model.SyncPlay @@ -10,6 +9,16 @@ namespace MediaBrowser.Model.SyncPlay public class GroupInfoDto { /// <summary> + /// Initializes a new instance of the <see cref="GroupInfoDto"/> class. + /// </summary> + public GroupInfoDto() + { + GroupId = string.Empty; + GroupName = string.Empty; + Participants = new List<string>(); + } + + /// <summary> /// Gets or sets the group identifier. /// </summary> /// <value>The group identifier.</value> @@ -37,6 +46,6 @@ namespace MediaBrowser.Model.SyncPlay /// Gets or sets the date when this dto has been updated. /// </summary> /// <value>The date when this dto has been updated.</value> - public string LastUpdatedAt { get; set; } + public DateTime LastUpdatedAt { get; set; } } } diff --git a/MediaBrowser.Model/SyncPlay/GroupQueueMode.cs b/MediaBrowser.Model/SyncPlay/GroupQueueMode.cs new file mode 100644 index 000000000..5c9c2627b --- /dev/null +++ b/MediaBrowser.Model/SyncPlay/GroupQueueMode.cs @@ -0,0 +1,18 @@ +namespace MediaBrowser.Model.SyncPlay +{ + /// <summary> + /// Enum GroupQueueMode. + /// </summary> + public enum GroupQueueMode + { + /// <summary> + /// Insert items at the end of the queue. + /// </summary> + Queue = 0, + + /// <summary> + /// Insert items after the currently playing item. + /// </summary> + QueueNext = 1 + } +} diff --git a/MediaBrowser.Model/SyncPlay/GroupRequestType.cs b/MediaBrowser.Model/SyncPlay/GroupRequestType.cs index e7361817c..75c071236 100644 --- a/MediaBrowser.Model/SyncPlay/GroupRequestType.cs +++ b/MediaBrowser.Model/SyncPlay/GroupRequestType.cs @@ -8,26 +8,26 @@ namespace MediaBrowser.Model.SyncPlay /// <summary> /// A user is requesting to create a new group. /// </summary> - NewGroup, + NewGroup = 0, /// <summary> /// A user is requesting to join a group. /// </summary> - JoinGroup, + JoinGroup = 1, /// <summary> /// A user is requesting to leave a group. /// </summary> - LeaveGroup, + LeaveGroup = 2, /// <summary> /// A user is requesting the list of available groups. /// </summary> - ListGroups, + ListGroups = 3, /// <summary> /// A user is sending a playback command to a group. /// </summary> - Playback + Playback = 4 } } diff --git a/MediaBrowser.Model/SyncPlay/GroupStateType.cs b/MediaBrowser.Model/SyncPlay/GroupStateType.cs index 341859b30..7aa454f92 100644 --- a/MediaBrowser.Model/SyncPlay/GroupStateType.cs +++ b/MediaBrowser.Model/SyncPlay/GroupStateType.cs @@ -8,21 +8,21 @@ namespace MediaBrowser.Model.SyncPlay /// <summary> /// The group is in idle state. No media is playing. /// </summary> - Idle, + Idle = 0, /// <summary> /// The group is in wating state. Playback is paused. Will start playing when users are ready. /// </summary> - Waiting, + Waiting = 1, /// <summary> /// The group is in paused state. Playback is paused. Will resume on play command. /// </summary> - Paused, + Paused = 2, /// <summary> /// The group is in playing state. Playback is advancing. /// </summary> - Playing + Playing = 3 } } diff --git a/MediaBrowser.Model/SyncPlay/NewGroupRequest.cs b/MediaBrowser.Model/SyncPlay/NewGroupRequest.cs index ccab5313f..eb61a68d1 100644 --- a/MediaBrowser.Model/SyncPlay/NewGroupRequest.cs +++ b/MediaBrowser.Model/SyncPlay/NewGroupRequest.cs @@ -1,5 +1,3 @@ -#nullable disable - namespace MediaBrowser.Model.SyncPlay { /// <summary> @@ -8,6 +6,14 @@ namespace MediaBrowser.Model.SyncPlay public class NewGroupRequest { /// <summary> + /// Initializes a new instance of the <see cref="NewGroupRequest"/> class. + /// </summary> + public NewGroupRequest() + { + GroupName = string.Empty; + } + + /// <summary> /// Gets or sets the group name. /// </summary> /// <value>The name of the new group.</value> diff --git a/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs b/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs index 575597e62..d193b4c66 100644 --- a/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs +++ b/MediaBrowser.Model/SyncPlay/PlayQueueUpdate.cs @@ -1,5 +1,4 @@ -#nullable disable - +using System; using System.Collections.Generic; namespace MediaBrowser.Model.SyncPlay @@ -10,6 +9,14 @@ namespace MediaBrowser.Model.SyncPlay public class PlayQueueUpdate { /// <summary> + /// Initializes a new instance of the <see cref="PlayQueueUpdate"/> class. + /// </summary> + public PlayQueueUpdate() + { + Playlist = new List<QueueItem>(); + } + + /// <summary> /// Gets or sets the request type that originated this update. /// </summary> /// <value>The reason for the update.</value> @@ -19,7 +26,7 @@ namespace MediaBrowser.Model.SyncPlay /// Gets or sets the UTC time of the last change to the playing queue. /// </summary> /// <value>The UTC time of the last change to the playing queue.</value> - public string LastUpdate { get; set; } + public DateTime LastUpdate { get; set; } /// <summary> /// Gets or sets the playlist. diff --git a/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs b/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs index 4b3f6eb4d..e78940fe6 100644 --- a/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs +++ b/MediaBrowser.Model/SyncPlay/PlayQueueUpdateReason.cs @@ -26,12 +26,12 @@ namespace MediaBrowser.Model.SyncPlay MoveItem = 3, /// <summary> - /// A user is making changes to the queue. + /// A user is adding items the queue. /// </summary> Queue = 4, /// <summary> - /// A user is making changes to the queue. + /// A user is adding items to the queue, after the currently playing item. /// </summary> QueueNext = 5, diff --git a/MediaBrowser.Model/SyncPlay/QueueItem.cs b/MediaBrowser.Model/SyncPlay/QueueItem.cs index ce253b182..9c4d3a4ce 100644 --- a/MediaBrowser.Model/SyncPlay/QueueItem.cs +++ b/MediaBrowser.Model/SyncPlay/QueueItem.cs @@ -1,5 +1,3 @@ -#nullable disable - using System; namespace MediaBrowser.Model.SyncPlay @@ -10,15 +8,26 @@ namespace MediaBrowser.Model.SyncPlay public class QueueItem { /// <summary> - /// Gets or sets the item identifier. + /// Initializes a new instance of the <see cref="QueueItem"/> class. + /// </summary> + /// <param name="itemId">The item identifier.</param> + /// <param name="playlistItemId">The playlist identifier of the item.</param> + public QueueItem(Guid itemId, string playlistItemId) + { + ItemId = itemId; + PlaylistItemId = playlistItemId; + } + + /// <summary> + /// Gets the item identifier. /// </summary> /// <value>The item identifier.</value> - public Guid ItemId { get; set; } + public Guid ItemId { get; } /// <summary> - /// Gets or sets the playlist identifier of the item. + /// Gets the playlist identifier of the item. /// </summary> /// <value>The playlist identifier of the item.</value> - public string PlaylistItemId { get; set; } + public string PlaylistItemId { get; } } } diff --git a/MediaBrowser.Model/SyncPlay/SendCommand.cs b/MediaBrowser.Model/SyncPlay/SendCommand.cs index b24f7e97b..a3aa54b38 100644 --- a/MediaBrowser.Model/SyncPlay/SendCommand.cs +++ b/MediaBrowser.Model/SyncPlay/SendCommand.cs @@ -1,4 +1,4 @@ -#nullable disable +using System; namespace MediaBrowser.Model.SyncPlay { @@ -8,6 +8,15 @@ namespace MediaBrowser.Model.SyncPlay public class SendCommand { /// <summary> + /// Initializes a new instance of the <see cref="SendCommand"/> class. + /// </summary> + public SendCommand() + { + GroupId = string.Empty; + PlaylistItemId = string.Empty; + } + + /// <summary> /// Gets or sets the group identifier. /// </summary> /// <value>The group identifier.</value> @@ -23,7 +32,7 @@ namespace MediaBrowser.Model.SyncPlay /// Gets or sets the UTC time when to execute the command. /// </summary> /// <value>The UTC time when to execute the command.</value> - public string When { get; set; } + public DateTime When { get; set; } /// <summary> /// Gets or sets the position ticks. @@ -41,6 +50,6 @@ namespace MediaBrowser.Model.SyncPlay /// Gets or sets the UTC time when this command has been emitted. /// </summary> /// <value>The UTC time when this command has been emitted.</value> - public string EmittedAt { get; set; } + public DateTime EmittedAt { get; set; } } } |
