Merge
This commit is contained in:
commit
86511152c2
|
@ -31,9 +31,14 @@ namespace MediaBrowser.Api
|
||||||
UserItemData = Kernel.Instance.GetUserItemData(userId, item.Id),
|
UserItemData = Kernel.Instance.GetUserItemData(userId, item.Id),
|
||||||
Type = item.GetType().Name,
|
Type = item.GetType().Name,
|
||||||
IsFolder = (item is Folder),
|
IsFolder = (item is Folder),
|
||||||
ParentId = item.Parent == null ? Guid.Empty : item.Parent.Id
|
ParentLogoItemId = GetParentLogoItemId(item)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (item.Parent != null)
|
||||||
|
{
|
||||||
|
wrapper.ParentId = item.Parent.Id;
|
||||||
|
}
|
||||||
|
|
||||||
if (includeChildren)
|
if (includeChildren)
|
||||||
{
|
{
|
||||||
var folder = item as Folder;
|
var folder = item as Folder;
|
||||||
|
@ -46,5 +51,25 @@ namespace MediaBrowser.Api
|
||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Guid? GetParentLogoItemId(BaseItem item)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(item.LogoImagePath))
|
||||||
|
{
|
||||||
|
var parent = item.Parent;
|
||||||
|
|
||||||
|
while (parent != null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(parent.LogoImagePath))
|
||||||
|
{
|
||||||
|
return parent.Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = parent.Parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,23 @@ namespace MediaBrowser.ApiInteraction
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseClient : IDisposable
|
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; }
|
protected HttpClient HttpClient { get; private set; }
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace MediaBrowser.Common.Kernel
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reloads application configuration from the config file
|
/// Reloads application configuration from the config file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ReloadConfiguration()
|
protected virtual void ReloadConfiguration()
|
||||||
{
|
{
|
||||||
//Configuration information for anything other than server-specific configuration will have to come via the API... -ebr
|
//Configuration information for anything other than server-specific configuration will have to come via the API... -ebr
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ namespace MediaBrowser.Common.Kernel
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disposes all resources currently in use.
|
/// Disposes all resources currently in use.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Dispose()
|
public virtual void Dispose()
|
||||||
{
|
{
|
||||||
DisposeHttpServer();
|
DisposeHttpServer();
|
||||||
DisposeLogger();
|
DisposeLogger();
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ServiceStack.Text">
|
<Reference Include="ServiceStack.Text, Version=3.9.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\ServiceStack.Text.3.8.5\lib\net35\ServiceStack.Text.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\packages\ServiceStack.Text.3.9.3\lib\net35\ServiceStack.Text.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.ComponentModel.Composition" />
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Rx-Main" version="1.0.11226" targetFramework="net45" />
|
<package id="Rx-Main" version="1.0.11226" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Text" version="3.8.5" targetFramework="net45" />
|
<package id="ServiceStack.Text" version="3.9.3" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
|
@ -26,7 +26,7 @@ namespace MediaBrowser.Model.Entities
|
||||||
|
|
||||||
public bool IsFolder { get; set; }
|
public bool IsFolder { get; set; }
|
||||||
|
|
||||||
public Guid ParentId { get; set; }
|
public Guid? ParentId { get; set; }
|
||||||
|
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
@ -39,5 +39,10 @@ namespace MediaBrowser.Model.Entities
|
||||||
{
|
{
|
||||||
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
|
return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If the item does not have a logo, this will hold the Id of the Parent that has one.
|
||||||
|
/// </summary>
|
||||||
|
public Guid? ParentLogoItemId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user