jellyfin-server/MediaBrowser.Api/HttpHandlers/UserHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti c7b305ee2e Added a user api handler, and improved portable ApiClient
2012-09-07 21:33:49 -04:00

22 lines
632 B
C#

using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Model.DTO;
using MediaBrowser.Model.Entities;
using System.Threading.Tasks;
namespace MediaBrowser.Api.HttpHandlers
{
class UserHandler : BaseSerializationHandler<DTOUser>
{
protected override Task<DTOUser> GetObjectToSerialize()
{
string id = QueryString["id"];
User user = string.IsNullOrEmpty(id) ? ApiService.GetDefaultUser(false) : ApiService.GetUserById(id, false); ;
DTOUser dto = ApiService.GetDTOUser(user);
return Task.FromResult<DTOUser>(dto);
}
}
}