mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 11:57:55 +02:00
32 lines
836 B
C#
32 lines
836 B
C#
using MediaBrowser.Common.Net.Handlers;
|
|
using MediaBrowser.Model.DTO;
|
|
using MediaBrowser.Model.Entities;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MediaBrowser.Api.HttpHandlers
|
|
{
|
|
public class ItemHandler : BaseSerializationHandler<DTOBaseItem>
|
|
{
|
|
protected override Task<DTOBaseItem> GetObjectToSerialize()
|
|
{
|
|
User user = ApiService.GetUserById(QueryString["userid"], true);
|
|
|
|
BaseItem item = ItemToSerialize;
|
|
|
|
if (item == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return ApiService.GetDTOBaseItem(item, user);
|
|
}
|
|
|
|
protected virtual BaseItem ItemToSerialize
|
|
{
|
|
get
|
|
{
|
|
return ApiService.GetItemById(QueryString["id"]);
|
|
}
|
|
}
|
|
}
|
|
}
|