2012-07-16 16:50:44 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2012-07-13 03:50:50 +00: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 02:22:44 +00:00
|
|
|
|
return ApiService.GetSerializationObject(i, false, UserId);
|
2012-07-13 03:50:50 +00:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected abstract IEnumerable<BaseItem> ItemsToSerialize
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
}
|
2012-07-16 16:50:44 +00:00
|
|
|
|
|
|
|
|
|
protected Guid UserId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Guid.Parse(QueryString["userid"]);
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-13 03:50:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|