jellyfin-server/MediaBrowser.Api/HttpHandlers/DefaultUserHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti f428c976aa Added a default user handler
2012-09-02 10:56:36 -04:00

22 lines
586 B
C#

using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.DTO;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
class DefaultUserHandler : BaseSerializationHandler<DTOUser>
{
protected override Task<DTOUser> GetObjectToSerialize()
{
User user = Kernel.Instance.Users.FirstOrDefault();
DTOUser dto = ApiService.GetDTOUser(user);
return Task.FromResult<DTOUser>(dto);
}
}
}