repo creation with initial code after cloning public repo
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CA1040
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing that the websocket message is inbound.
|
||||
/// </summary>
|
||||
public interface IInboundWebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CA1040
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing that the websocket message is outbound.
|
||||
/// </summary>
|
||||
public interface IOutboundWebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log entry start message.
|
||||
/// Data is the timing data encoded as "$initialDelay,$interval" in ms.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryStartMessage : InboundWebSocketMessage<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryStartMessage"/> class.
|
||||
/// Data is the timing data encoded as "$initialDelay,$interval" in ms.
|
||||
/// </summary>
|
||||
/// <param name="data">The timing data encoded as "$initialDelay,$interval".</param>
|
||||
public ActivityLogEntryStartMessage(string data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntryStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntryStart;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log entry stop message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryStopMessage : InboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntryStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntryStop;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Keep alive websocket messages.
|
||||
/// </summary>
|
||||
public class InboundKeepAliveMessage : InboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.KeepAlive)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.KeepAlive;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info start message.
|
||||
/// Data is the timing data encoded as "$initialDelay,$interval" in ms.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoStartMessage : InboundWebSocketMessage<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The timing data encoded as $initialDelay,$interval.</param>
|
||||
public ScheduledTasksInfoStartMessage(string data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfoStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfoStart;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info stop message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoStopMessage : InboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfoStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfoStop;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions start message.
|
||||
/// Data is the timing data encoded as "$initialDelay,$interval" in ms.
|
||||
/// </summary>
|
||||
public class SessionsStartMessage : InboundWebSocketMessage<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The timing data encoded as $initialDelay,$interval.</param>
|
||||
public SessionsStartMessage(string data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SessionsStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SessionsStart;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions stop message.
|
||||
/// </summary>
|
||||
public class SessionsStopMessage : InboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SessionsStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SessionsStop;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Inbound websocket message.
|
||||
/// </summary>
|
||||
public class InboundWebSocketMessage : WebSocketMessage, IInboundWebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma warning disable SA1649 // File name must equal class name.
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Inbound websocket message with data.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The data type.</typeparam>
|
||||
public class InboundWebSocketMessage<T> : WebSocketMessage<T>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InboundWebSocketMessage{T}"/> class.
|
||||
/// </summary>
|
||||
public InboundWebSocketMessage()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InboundWebSocketMessage{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The data to send.</param>
|
||||
protected InboundWebSocketMessage(T data)
|
||||
{
|
||||
Data = data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log created message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryMessage : OutboundWebSocketMessage<IReadOnlyList<ActivityLogEntry>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">List of activity log entries.</param>
|
||||
public ActivityLogEntryMessage(IReadOnlyList<ActivityLogEntry> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntry)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntry;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Force keep alive websocket messages.
|
||||
/// </summary>
|
||||
public class ForceKeepAliveMessage : OutboundWebSocketMessage<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ForceKeepAliveMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The timeout in seconds.</param>
|
||||
public ForceKeepAliveMessage(int data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ForceKeepAlive)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ForceKeepAlive;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// General command websocket message.
|
||||
/// </summary>
|
||||
public class GeneralCommandMessage : OutboundWebSocketMessage<GeneralCommand>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeneralCommandMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The general command.</param>
|
||||
public GeneralCommandMessage(GeneralCommand data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.GeneralCommand)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.GeneralCommand;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Library changed message.
|
||||
/// </summary>
|
||||
public class LibraryChangedMessage : OutboundWebSocketMessage<LibraryUpdateInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibraryChangedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The library update info.</param>
|
||||
public LibraryChangedMessage(LibraryUpdateInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.LibraryChanged)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.LibraryChanged;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Keep alive websocket messages.
|
||||
/// </summary>
|
||||
public class OutboundKeepAliveMessage : OutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.KeepAlive)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.KeepAlive;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Play command websocket message.
|
||||
/// </summary>
|
||||
public class PlayMessage : OutboundWebSocketMessage<PlayRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The play request.</param>
|
||||
public PlayMessage(PlayRequest data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.Play)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.Play;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Playstate message.
|
||||
/// </summary>
|
||||
public class PlaystateMessage : OutboundWebSocketMessage<PlaystateRequest>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlaystateMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Playstate request data.</param>
|
||||
public PlaystateMessage(PlaystateRequest data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.Playstate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.Playstate;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin installation cancelled message.
|
||||
/// </summary>
|
||||
public class PluginInstallationCancelledMessage : OutboundWebSocketMessage<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationCancelledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallationCancelledMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstallationCancelled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstallationCancelled;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin installation completed message.
|
||||
/// </summary>
|
||||
public class PluginInstallationCompletedMessage : OutboundWebSocketMessage<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationCompletedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallationCompletedMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstallationCompleted)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstallationCompleted;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin installation failed message.
|
||||
/// </summary>
|
||||
public class PluginInstallationFailedMessage : OutboundWebSocketMessage<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationFailedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallationFailedMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstallationFailed)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstallationFailed;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Package installing message.
|
||||
/// </summary>
|
||||
public class PluginInstallingMessage : OutboundWebSocketMessage<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallingMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallingMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstalling)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstalling;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin uninstalled message.
|
||||
/// </summary>
|
||||
public class PluginUninstalledMessage : OutboundWebSocketMessage<PluginInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginUninstalledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Plugin info.</param>
|
||||
public PluginUninstalledMessage(PluginInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageUninstalled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageUninstalled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Refresh progress message.
|
||||
/// </summary>
|
||||
public class RefreshProgressMessage : OutboundWebSocketMessage<Dictionary<string, string>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RefreshProgressMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Refresh progress data.</param>
|
||||
public RefreshProgressMessage(Dictionary<string, string> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.RefreshProgress)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.RefreshProgress;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Restart required.
|
||||
/// </summary>
|
||||
public class RestartRequiredMessage : OutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.RestartRequired)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.RestartRequired;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled task ended message.
|
||||
/// </summary>
|
||||
public class ScheduledTaskEndedMessage : OutboundWebSocketMessage<TaskResult>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTaskEndedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Task result.</param>
|
||||
public ScheduledTaskEndedMessage(TaskResult data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTaskEnded)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTaskEnded;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoMessage : OutboundWebSocketMessage<IReadOnlyList<TaskInfo>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">List of task infos.</param>
|
||||
public ScheduledTasksInfoMessage(IReadOnlyList<TaskInfo> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfo)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfo;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Series timer cancelled message.
|
||||
/// </summary>
|
||||
public class SeriesTimerCancelledMessage : OutboundWebSocketMessage<TimerEventInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeriesTimerCancelledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The timer event info.</param>
|
||||
public SeriesTimerCancelledMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SeriesTimerCancelled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SeriesTimerCancelled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Series timer created message.
|
||||
/// </summary>
|
||||
public class SeriesTimerCreatedMessage : OutboundWebSocketMessage<TimerEventInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeriesTimerCreatedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">timer event info.</param>
|
||||
public SeriesTimerCreatedMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SeriesTimerCreated)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SeriesTimerCreated;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Server restarting down message.
|
||||
/// </summary>
|
||||
public class ServerRestartingMessage : OutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ServerRestarting)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ServerRestarting;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Server shutting down message.
|
||||
/// </summary>
|
||||
public class ServerShuttingDownMessage : OutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ServerShuttingDown)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ServerShuttingDown;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions message.
|
||||
/// </summary>
|
||||
public class SessionsMessage : OutboundWebSocketMessage<IReadOnlyList<SessionInfoDto>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Session info.</param>
|
||||
public SessionsMessage(IReadOnlyList<SessionInfoDto> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.Sessions)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.Sessions;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sync play command.
|
||||
/// </summary>
|
||||
public class SyncPlayCommandMessage : OutboundWebSocketMessage<SendCommand>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayCommandMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The send command.</param>
|
||||
public SyncPlayCommandMessage(SendCommand data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayCommand)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayCommand;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Timer cancelled message.
|
||||
/// </summary>
|
||||
public class TimerCancelledMessage : OutboundWebSocketMessage<TimerEventInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TimerCancelledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Timer event info.</param>
|
||||
public TimerCancelledMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.TimerCancelled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.TimerCancelled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Timer created message.
|
||||
/// </summary>
|
||||
public class TimerCreatedMessage : OutboundWebSocketMessage<TimerEventInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TimerCreatedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Timer event info.</param>
|
||||
public TimerCreatedMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.TimerCreated)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.TimerCreated;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// User data changed message.
|
||||
/// </summary>
|
||||
public class UserDataChangedMessage : OutboundWebSocketMessage<UserDataChangeInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserDataChangedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The data change info.</param>
|
||||
public UserDataChangedMessage(UserDataChangeInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.UserDataChanged)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.UserDataChanged;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// User deleted message.
|
||||
/// </summary>
|
||||
public class UserDeletedMessage : OutboundWebSocketMessage<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserDeletedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The user id.</param>
|
||||
public UserDeletedMessage(Guid data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.UserDeleted)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.UserDeleted;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// User updated message.
|
||||
/// </summary>
|
||||
public class UserUpdatedMessage : OutboundWebSocketMessage<UserDto>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserUpdatedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The user dto.</param>
|
||||
public UserUpdatedMessage(UserDto data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.UserUpdated)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.UserUpdated;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Outbound websocket message.
|
||||
/// </summary>
|
||||
public class OutboundWebSocketMessage : WebSocketMessage, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the message id.
|
||||
/// </summary>
|
||||
public Guid MessageId { get; set; } = Guid.NewGuid();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma warning disable SA1649 // File name must equal class name.
|
||||
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Outbound websocket message with data.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The data type.</typeparam>
|
||||
public class OutboundWebSocketMessage<T> : WebSocketMessage<T>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutboundWebSocketMessage{T}"/> class.
|
||||
/// </summary>
|
||||
public OutboundWebSocketMessage()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OutboundWebSocketMessage{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The data to send.</param>
|
||||
protected OutboundWebSocketMessage(T data)
|
||||
{
|
||||
Data = data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the message id.
|
||||
/// </summary>
|
||||
public Guid MessageId { get; set; } = Guid.NewGuid();
|
||||
}
|
||||
Reference in New Issue
Block a user