diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-01 15:09:24 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-01 15:09:24 -0400 |
| commit | 80fd8d015626cbb5ed9ea8678149b13a4a1272f4 (patch) | |
| tree | 9a4485a5407957a8f896951afda038f4e4505e17 | |
| parent | 00c22a34546ee426cc7097953eb6b1c3443f946b (diff) | |
Added ApiPort and ServerHostName to ApiClient
| -rw-r--r-- | MediaBrowser.ApiInteraction/BaseClient.cs | 18 | ||||
| -rw-r--r-- | 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 bd25b1653..887c1779f 100644 --- a/MediaBrowser.ApiInteraction/BaseClient.cs +++ b/MediaBrowser.ApiInteraction/BaseClient.cs @@ -8,7 +8,23 @@ namespace MediaBrowser.ApiInteraction /// </summary>
public abstract class BaseClient : IDisposable
{
- public string ApiUrl { get; set; }
+ /// <summary>
+ /// Gets or sets the server host name (myserver or 192.168.x.x)
+ /// </summary>
+ public string ServerHostName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the port number used by the API
+ /// </summary>
+ 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 cc3cb76f0..3442787bc 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -214,7 +214,7 @@ namespace MediaBrowser.Common.Kernel /// <summary>
/// Reloads application configuration from the config file
/// </summary>
- private void ReloadConfiguration()
+ protected virtual void ReloadConfiguration()
{
// Deserialize config
if (!File.Exists(ConfigurationPath))
@@ -270,7 +270,7 @@ namespace MediaBrowser.Common.Kernel /// <summary>
/// Disposes all resources currently in use.
/// </summary>
- public void Dispose()
+ public virtual void Dispose()
{
DisposeHttpServer();
DisposeLogger();
|
