2012-07-16 18:50:44 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2012-07-13 05:50:50 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Api.HttpHandlers
|
|
|
|
|
{
|
|
|
|
|
public abstract class ItemListHandler : JsonHandler
|
|
|
|
|
{
|
|
|
|
|
protected sealed override object ObjectToSerialize
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return ItemsToSerialize.Select(i =>
|
|
|
|
|
{
|
2012-07-20 04:22:44 +02:00
|
|
|
|
return ApiService.GetSerializationObject(i, false, UserId);
|
2012-07-13 05:50:50 +02:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected abstract IEnumerable<BaseItem> ItemsToSerialize
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
}
|
2012-07-16 18:50:44 +02:00
|
|
|
|
|
|
|
|
|
protected Guid UserId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Guid.Parse(QueryString["userid"]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-13 05:50:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|