diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-09-02 09:45:02 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-09-02 09:45:02 -0400 |
| commit | e52833059bc819cbdb41ba204b82aee1760ddb3a (patch) | |
| tree | e55fd39ffcbc2d268639610cf78b987b21973884 /MediaBrowser.ApiInteraction | |
| parent | 7ad612bb4b181a7426c1ba2d15692c1f230d236c (diff) | |
Moved server configuration to the model so that the UI can read it
Diffstat (limited to 'MediaBrowser.ApiInteraction')
| -rw-r--r-- | MediaBrowser.ApiInteraction/ApiClient.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index 99af250ca8..922b4bb0c9 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -4,6 +4,7 @@ using System.IO; using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
+using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.DTO;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Weather;
@@ -568,7 +569,20 @@ namespace MediaBrowser.ApiInteraction /// <summary>
/// Gets weather information for the default location as set in configuration
/// </summary>
- public async Task<WeatherInfo> GetWeatherInfo()
+ public async Task<ServerConfiguration> GetServerConfigurationAsync()
+ {
+ string url = ApiUrl + "/ServerConfiguration";
+
+ using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
+ {
+ return DeserializeFromStream<ServerConfiguration>(stream);
+ }
+ }
+
+ /// <summary>
+ /// Gets weather information for the default location as set in configuration
+ /// </summary>
+ public async Task<WeatherInfo> GetWeatherInfoAsync()
{
string url = ApiUrl + "/weather";
@@ -581,7 +595,7 @@ namespace MediaBrowser.ApiInteraction /// <summary>
/// Gets weather information for a specific zip code
/// </summary>
- public async Task<WeatherInfo> GetWeatherInfo(string zipCode)
+ public async Task<WeatherInfo> GetWeatherInfoAsync(string zipCode)
{
string url = ApiUrl + "/weather?zipcode=" + zipCode;
|
