mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
Added a user api handler, and improved portable ApiClient
This commit is contained in:
parent
23ea228079
commit
c7b305ee2e
21
MediaBrowser.Api/HttpHandlers/UserHandler.cs
Normal file
21
MediaBrowser.Api/HttpHandlers/UserHandler.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user