jellyfin-server/MediaBrowser.Api/HttpHandlers/RecentlyAddedItemsHandler.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

30 lines
796 B
C#

using System.Collections.Generic;
using MediaBrowser.Common.Net;
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")
{
return ApiService.GetRecentlyAddedUnplayedItems(parent);
}
return ApiService.GetRecentlyAddedItems(parent);
}
}
}
}