Explorar o código

Added GetRecentlyAddedItemsAsync method in ApiClient.

ScottIsAFool Scott Lovegrove ScottIsAFool %!s(int64=12) %!d(string=hai) anos
pai
achega
300cf1ba18
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      MediaBrowser.ApiInteraction/ApiClient.cs

+ 14 - 0
MediaBrowser.ApiInteraction/ApiClient.cs

@@ -104,6 +104,20 @@ namespace MediaBrowser.ApiInteraction
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Gets the recently added items
+        /// </summary>
+        /// <param name="userId">The user id.</param>
+        /// <returns></returns>
+        public async Task<DTOBaseItem[]> GetRecentlyAddedItemsAsync(Guid userId)
+        {
+            string url = ApiUrl + "/itemlist?listtype=recentlyaddeditems&userId=" + userId.ToString();
+            using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(true))
+            {
+                return DeserializeFromStream<DTOBaseItem[]>(stream);
+            }
+        } 
+
         /// <summary>
         /// <summary>
         /// Gets all Years
         /// Gets all Years
         /// </summary>
         /// </summary>