2012-07-13 03:50:50 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using MediaBrowser.Common.Net;
|
2012-07-16 16:50:44 +00:00
|
|
|
|
using MediaBrowser.Controller;
|
2012-07-13 03:50:50 +00:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Api.HttpHandlers
|
|
|
|
|
{
|
|
|
|
|
class RecentlyAddedItemsHandler : ItemListHandler
|
|
|
|
|
{
|
|
|
|
|
public RecentlyAddedItemsHandler(RequestContext ctx)
|
|
|
|
|
: base(ctx)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IEnumerable<BaseItem> ItemsToSerialize
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
|
|
|
|
|
|
|
|
|
|
if (QueryString["unplayed"] == "1")
|
|
|
|
|
{
|
2012-07-16 16:50:44 +00:00
|
|
|
|
return Kernel.Instance.GetRecentlyAddedUnplayedItems(parent, UserId);
|
2012-07-13 03:50:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-07-16 16:50:44 +00:00
|
|
|
|
return Kernel.Instance.GetRecentlyAddedItems(parent, UserId);
|
2012-07-13 03:50:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|