aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ApiInteraction/ApiClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.ApiInteraction/ApiClient.cs')
-rw-r--r--MediaBrowser.ApiInteraction/ApiClient.cs22
1 files changed, 20 insertions, 2 deletions
diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs
index 5de175095..0315d9dd9 100644
--- a/MediaBrowser.ApiInteraction/ApiClient.cs
+++ b/MediaBrowser.ApiInteraction/ApiClient.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.DTO;
+using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Weather;
using System;
using System.IO;
@@ -82,13 +83,30 @@ namespace MediaBrowser.ApiInteraction
public async Task<DTOBaseItem[]> GetRecentlyAddedItemsAsync(Guid userId)
{
string url = ApiUrl + "/itemlist?listtype=recentlyaddeditems&userId=" + userId.ToString();
- using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(true))
+
+ using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
{
return DeserializeFromStream<DTOBaseItem[]>(stream);
}
- }
+ }
/// <summary>
+ /// Gets recently added items within a specific folder
+ /// </summary>
+ /// <param name="userId">The user id.</param>
+ public async Task<DTOBaseItem[]> GetRecentlyAddedItemsAsync(Guid userId, Guid folderId)
+ {
+ string url = ApiUrl + "/itemlist?listtype=recentlyaddeditems&userId=" + userId.ToString();
+
+ url += "&id=" + folderId.ToString();
+
+ using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
+ {
+ return DeserializeFromStream<DTOBaseItem[]>(stream);
+ }
+ }
+
+ /// <summary>
/// Gets all Years
/// </summary>
public async Task<IBNItem[]> GetAllYearsAsync(Guid userId)