jellyfin-server/MediaBrowser.WebDashboard/Api/DashboardInfoWebSocketListener.cs

34 lines
1010 B
C#
Raw Normal View History

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