From 15e9c7aca80e22ffa4cba520e904882db3fc98b3 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Wed, 5 Sep 2012 20:17:54 -0400 Subject: [PATCH] Fixed protobuf reference --- .../MediaBrowser.ApiInteraction.Metro.csproj | 2 +- MediaBrowser.ApiInteraction/ApiClient.cs | 27 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/MediaBrowser.ApiInteraction.Metro/MediaBrowser.ApiInteraction.Metro.csproj b/MediaBrowser.ApiInteraction.Metro/MediaBrowser.ApiInteraction.Metro.csproj index 216ba19ab3..9d84b20c0b 100644 --- a/MediaBrowser.ApiInteraction.Metro/MediaBrowser.ApiInteraction.Metro.csproj +++ b/MediaBrowser.ApiInteraction.Metro/MediaBrowser.ApiInteraction.Metro.csproj @@ -49,7 +49,7 @@ - ..\protobuf-net\Full\netcore45\protobuf-net.dll + ..\protobuf-net\Full\portable\protobuf-net.dll ..\packages\ServiceStack.Text.3.9.5\lib\sl5\ServiceStack.Text.dll diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index 8e3327f01a..80ea82ca27 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Http; @@ -50,7 +49,7 @@ namespace MediaBrowser.ApiInteraction { get { - return ApiInteraction.SerializationFormat.Jsv; + return ApiInteraction.SerializationFormat.Protobuf; } } @@ -306,7 +305,7 @@ namespace MediaBrowser.ApiInteraction /// Use if a max width is required. Aspect ratio will be preserved. /// Use if a max height is required. Aspect ratio will be preserved. /// Quality level, from 0-100. Currently only applies to JPG. The default value should suffice. - public IEnumerable GetBackdropImageUrls(DTOBaseItem item, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? quality = null) + public string[] GetBackdropImageUrls(DTOBaseItem item, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? quality = null) { Guid? backdropItemId = null; int backdropCount = 0; @@ -327,11 +326,11 @@ namespace MediaBrowser.ApiInteraction return new string[] { }; } - List files = new List(); + string[] files = new string[backdropCount]; for (int i = 0; i < backdropCount; i++) { - files.Add(GetImageUrl(backdropItemId.Value, ImageType.Backdrop, i, width, height, maxWidth, maxHeight, quality)); + files[i] = GetImageUrl(backdropItemId.Value, ImageType.Backdrop, i, width, height, maxWidth, maxHeight, quality); } return files; @@ -387,7 +386,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all Users /// - public async Task> GetAllUsersAsync() + public async Task GetAllUsersAsync() { string url = ApiUrl + "/users"; @@ -400,7 +399,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all Genres /// - public async Task> GetAllGenresAsync(Guid userId) + public async Task GetAllGenresAsync(Guid userId) { string url = ApiUrl + "/genres?userId=" + userId.ToString(); @@ -413,7 +412,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all Years /// - public async Task> GetAllYearsAsync(Guid userId) + public async Task GetAllYearsAsync(Guid userId) { string url = ApiUrl + "/years?userId=" + userId.ToString(); @@ -426,7 +425,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all items that contain a given Year /// - public async Task> GetItemsWithYearAsync(string name, Guid userId) + public async Task GetItemsWithYearAsync(string name, Guid userId) { string url = ApiUrl + "/itemlist?listtype=itemswithyear&userId=" + userId.ToString() + "&name=" + name; @@ -439,7 +438,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all items that contain a given Genre /// - public async Task> GetItemsWithGenreAsync(string name, Guid userId) + public async Task GetItemsWithGenreAsync(string name, Guid userId) { string url = ApiUrl + "/itemlist?listtype=itemswithgenre&userId=" + userId.ToString() + "&name=" + name; @@ -452,7 +451,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all items that contain a given Person /// - public async Task> GetItemsWithPersonAsync(string name, Guid userId) + public async Task GetItemsWithPersonAsync(string name, Guid userId) { string url = ApiUrl + "/itemlist?listtype=itemswithperson&userId=" + userId.ToString() + "&name=" + name; @@ -465,7 +464,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all items that contain a given Person /// - public async Task> GetItemsWithPersonAsync(string name, string personType, Guid userId) + public async Task GetItemsWithPersonAsync(string name, string personType, Guid userId) { string url = ApiUrl + "/itemlist?listtype=itemswithperson&userId=" + userId.ToString() + "&name=" + name; @@ -480,7 +479,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all studious /// - public async Task> GetAllStudiosAsync(Guid userId) + public async Task GetAllStudiosAsync(Guid userId) { string url = ApiUrl + "/studios?userId=" + userId.ToString(); @@ -493,7 +492,7 @@ namespace MediaBrowser.ApiInteraction /// /// Gets all items that contain a given Studio /// - public async Task> GetItemsWithStudioAsync(string name, Guid userId) + public async Task GetItemsWithStudioAsync(string name, Guid userId) { string url = ApiUrl + "/itemlist?listtype=itemswithstudio&userId=" + userId.ToString() + "&name=" + name;