Merge pull request #2882 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-09-15 02:32:54 -04:00 committed by GitHub
commit 7b92139173
9 changed files with 175 additions and 152 deletions

View File

@ -4716,6 +4716,33 @@ namespace Emby.Server.Implementations.Data
public void UpdateInheritedValues(CancellationToken cancellationToken) public void UpdateInheritedValues(CancellationToken cancellationToken)
{ {
UpdateInheritedTags(cancellationToken);
}
private void UpdateInheritedTags(CancellationToken cancellationToken)
{
using (WriteLock.Write())
{
using (var connection = CreateConnection())
{
connection.RunInTransaction(db =>
{
connection.ExecuteAll(string.Join(";", new string[]
{
"delete from itemvalues where type = 6",
"insert into itemvalues (ItemId, Type, Value, CleanValue) select ItemId, 6, Value, CleanValue from ItemValues where Type=4",
@"insert into itemvalues (ItemId, Type, Value, CleanValue) select AncestorIds.itemid, 6, ItemValues.Value, ItemValues.CleanValue
FROM AncestorIds
LEFT JOIN ItemValues ON (AncestorIds.AncestorId = ItemValues.ItemId)
where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type = 4 "
}));
}, TransactionMode);
}
}
} }
private static Dictionary<string, string[]> GetTypeMapDictionary() private static Dictionary<string, string[]> GetTypeMapDictionary()

View File

@ -15,5 +15,6 @@ namespace MediaBrowser.Controller.Entities
bool IsPremiere { get; set; } bool IsPremiere { get; set; }
ProgramAudio? Audio { get; set; } ProgramAudio? Audio { get; set; }
string EpisodeTitle { get; set; } string EpisodeTitle { get; set; }
string ServiceName { get; set; }
} }
} }

View File

@ -89,24 +89,9 @@ namespace MediaBrowser.Controller.LiveTv
} }
} }
private static string EmbyServiceName = "Emby";
public override double? GetDefaultPrimaryImageAspectRatio() public override double? GetDefaultPrimaryImageAspectRatio()
{ {
var serviceName = ServiceName; return LiveTvProgram.GetDefaultPrimaryImageAspectRatio(this);
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName))
{
double value = 16;
value /= 9;
return value;
}
else
{
double value = 2;
value /= 3;
return value;
}
} }
public override string GetClientTypeName() public override string GetClientTypeName()

View File

@ -47,11 +47,10 @@ namespace MediaBrowser.Controller.LiveTv
return list; return list;
} }
private static string EmbyServiceName = "Emby"; public static double? GetDefaultPrimaryImageAspectRatio(IHasProgramAttributes item)
public override double? GetDefaultPrimaryImageAspectRatio()
{ {
var serviceName = ServiceName; var serviceName = item.ServiceName;
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName)) if (!item.IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase))
{ {
double value = 16; double value = 16;
value /= 9; value /= 9;
@ -67,6 +66,12 @@ namespace MediaBrowser.Controller.LiveTv
} }
} }
private static string EmbyServiceName = "Emby";
public override double? GetDefaultPrimaryImageAspectRatio()
{
return GetDefaultPrimaryImageAspectRatio(this);
}
[IgnoreDataMember] [IgnoreDataMember]
public override SourceType SourceType public override SourceType SourceType
{ {

View File

@ -98,24 +98,9 @@ namespace MediaBrowser.Controller.LiveTv
return false; return false;
} }
private static string EmbyServiceName = "Emby";
public override double? GetDefaultPrimaryImageAspectRatio() public override double? GetDefaultPrimaryImageAspectRatio()
{ {
var serviceName = ServiceName; return LiveTvProgram.GetDefaultPrimaryImageAspectRatio(this);
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName))
{
double value = 16;
value /= 9;
return value;
}
else
{
double value = 2;
value /= 3;
return value;
}
} }
[IgnoreDataMember] [IgnoreDataMember]

View File

@ -4,6 +4,10 @@
{ {
public string Name { get; set; } public string Name { get; set; }
public string DisplayName { get; set; }
public string EmbeddedResourcePath { get; set; } public string EmbeddedResourcePath { get; set; }
public bool EnableInMainMenu { get; set; }
} }
} }

View File

@ -11,6 +11,9 @@ namespace MediaBrowser.WebDashboard.Api
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name { get; set; } public string Name { get; set; }
public bool EnableInMainMenu { get; set; }
public string DisplayName { get; set; }
/// <summary> /// <summary>
/// Gets the type of the configuration page. /// Gets the type of the configuration page.
@ -27,15 +30,22 @@ namespace MediaBrowser.WebDashboard.Api
public ConfigurationPageInfo(IPluginConfigurationPage page) public ConfigurationPageInfo(IPluginConfigurationPage page)
{ {
Name = page.Name; Name = page.Name;
ConfigurationPageType = page.ConfigurationPageType; ConfigurationPageType = page.ConfigurationPageType;
if (page.Plugin != null)
{
DisplayName = page.Plugin.Name;
// Don't use "N" because it needs to match Plugin.Id // Don't use "N" because it needs to match Plugin.Id
PluginId = page.Plugin.Id.ToString(); PluginId = page.Plugin.Id.ToString();
} }
}
public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page) public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page)
{ {
Name = page.Name; Name = page.Name;
EnableInMainMenu = page.EnableInMainMenu;
DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin.Name : page.DisplayName;
// Don't use "N" because it needs to match Plugin.Id // Don't use "N" because it needs to match Plugin.Id
PluginId = plugin.Id.ToString(); PluginId = plugin.Id.ToString();

View File

@ -32,6 +32,7 @@ namespace MediaBrowser.WebDashboard.Api
/// </summary> /// </summary>
/// <value>The type of the page.</value> /// <value>The type of the page.</value>
public ConfigurationPageType? PageType { get; set; } public ConfigurationPageType? PageType { get; set; }
public bool? EnableInMainMenu { get; set; }
} }
/// <summary> /// <summary>
@ -221,25 +222,20 @@ namespace MediaBrowser.WebDashboard.Api
/// <returns>System.Object.</returns> /// <returns>System.Object.</returns>
public object Get(GetDashboardConfigurationPages request) public object Get(GetDashboardConfigurationPages request)
{ {
const string unavilableMessage = "The server is still loading. Please try again momentarily."; const string unavailableMessage = "The server is still loading. Please try again momentarily.";
var instance = ServerEntryPoint.Instance; var instance = ServerEntryPoint.Instance;
if (instance == null) if (instance == null)
{ {
throw new InvalidOperationException(unavilableMessage); throw new InvalidOperationException(unavailableMessage);
} }
var pages = instance.PluginConfigurationPages; var pages = instance.PluginConfigurationPages;
if (pages == null) if (pages == null)
{ {
throw new InvalidOperationException(unavilableMessage); throw new InvalidOperationException(unavailableMessage);
}
if (request.PageType.HasValue)
{
pages = pages.Where(p => p.ConfigurationPageType == request.PageType.Value).ToList();
} }
// Don't allow a failing plugin to fail them all // Don't allow a failing plugin to fail them all
@ -261,6 +257,16 @@ namespace MediaBrowser.WebDashboard.Api
configPages.AddRange(_appHost.Plugins.SelectMany(GetConfigPages)); configPages.AddRange(_appHost.Plugins.SelectMany(GetConfigPages));
if (request.PageType.HasValue)
{
configPages = configPages.Where(p => p.ConfigurationPageType == request.PageType.Value).ToList();
}
if (request.EnableInMainMenu.HasValue)
{
configPages = configPages.Where(p => p.EnableInMainMenu == request.EnableInMainMenu.Value).ToList();
}
return _resultFactory.GetOptimizedResult(Request, configPages); return _resultFactory.GetOptimizedResult(Request, configPages);
} }

View File

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.30.20")] [assembly: AssemblyVersion("3.2.30.21")]