jellyfin-server/MediaBrowser.Api/HttpHandlers/ItemListHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti 5f5f2838b1 moved the http server to common, added more http handlers
2012-07-12 23:50:50 -04:00

34 lines
795 B
C#

using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Common.Net;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Api.HttpHandlers
{
public abstract class ItemListHandler : JsonHandler
{
public ItemListHandler(RequestContext ctx)
: base(ctx)
{
}
protected sealed override object ObjectToSerialize
{
get
{
return ItemsToSerialize.Select(i =>
{
return ItemHandler.GetSerializationObject(i, false);
});
}
}
protected abstract IEnumerable<BaseItem> ItemsToSerialize
{
get;
}
}
}