From 80fd8d015626cbb5ed9ea8678149b13a4a1272f4 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Wed, 1 Aug 2012 15:09:24 -0400 Subject: [PATCH] Added ApiPort and ServerHostName to ApiClient --- MediaBrowser.ApiInteraction/BaseClient.cs | 18 +++++++++++++++++- MediaBrowser.Common/Kernel/BaseKernel.cs | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.ApiInteraction/BaseClient.cs b/MediaBrowser.ApiInteraction/BaseClient.cs index bd25b1653b..887c1779fe 100644 --- a/MediaBrowser.ApiInteraction/BaseClient.cs +++ b/MediaBrowser.ApiInteraction/BaseClient.cs @@ -8,7 +8,23 @@ namespace MediaBrowser.ApiInteraction /// public abstract class BaseClient : IDisposable { - public string ApiUrl { get; set; } + /// + /// Gets or sets the server host name (myserver or 192.168.x.x) + /// + public string ServerHostName { get; set; } + + /// + /// Gets or sets the port number used by the API + /// + public int ApiPort { get; set; } + + protected string ApiUrl + { + get + { + return string.Format("http://{0}:{1}/mediabrowser/api", ServerHostName, ApiPort); + } + } protected HttpClient HttpClient { get; private set; } diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index cc3cb76f08..3442787bcb 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -214,7 +214,7 @@ namespace MediaBrowser.Common.Kernel /// /// Reloads application configuration from the config file /// - private void ReloadConfiguration() + protected virtual void ReloadConfiguration() { // Deserialize config if (!File.Exists(ConfigurationPath)) @@ -270,7 +270,7 @@ namespace MediaBrowser.Common.Kernel /// /// Disposes all resources currently in use. /// - public void Dispose() + public virtual void Dispose() { DisposeHttpServer(); DisposeLogger();