jellyfin/MediaBrowser.Api/HttpHandlers/UsersHandler.cs

26 lines
793 B
C#
Raw Normal View History

2012-09-07 16:17:39 +00:00
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.DTO;
2012-09-07 16:17:39 +00:00
using System.Collections.Generic;
using System.ComponentModel.Composition;
2012-09-07 16:17:39 +00:00
using System.Linq;
using System.Net;
2012-09-07 16:17:39 +00:00
using System.Threading.Tasks;
namespace MediaBrowser.Api.HttpHandlers
{
[Export(typeof(BaseHandler))]
2012-09-11 18:20:12 +00:00
class UsersHandler : BaseSerializationHandler<IEnumerable<DtoUser>>
{
public override bool HandlesRequest(HttpListenerRequest request)
{
return ApiService.IsApiUrlMatch("users", request);
}
2012-09-11 18:20:12 +00:00
protected override Task<IEnumerable<DtoUser>> GetObjectToSerialize()
{
2012-09-11 18:20:12 +00:00
return Task.FromResult(Kernel.Instance.Users.Select(u => ApiService.GetDtoUser(u)));
}
}
}