jellyfin-server/MediaBrowser.Common/Api/SystemInfoWebSocketListener.cs

33 lines
953 B
C#
Raw Normal View History

2013-02-21 01:33:05 +00:00
using MediaBrowser.Common.Kernel;
using System.ComponentModel.Composition;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Api
{
/// <summary>
/// Class SystemInfoWebSocketListener
/// </summary>
[Export(typeof(IWebSocketListener))]
public class SystemInfoWebSocketListener : BasePeriodicWebSocketListener<IKernel, Model.System.SystemInfo, object>
{
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
protected override string Name
{
get { return "SystemInfo"; }
}
/// <summary>
/// Gets the data to send.
/// </summary>
/// <param name="state">The state.</param>
/// <returns>Task{SystemInfo}.</returns>
protected override Task<Model.System.SystemInfo> GetDataToSend(object state)
{
return Task.FromResult(Kernel.GetSystemInfo());
}
}
}