Merge pull request #2850 from MediaBrowser/dev

3.2.29.2
This commit is contained in:
Luke 2017-08-28 12:41:58 -04:00 committed by GitHub
commit a3168a87b3
5 changed files with 26 additions and 12 deletions

View File

@ -316,7 +316,6 @@ namespace Emby.Dlna
profile = ReserializeProfile(tempProfile);
profile.Id = path.ToLower().GetMD5().ToString("N");
profile.ProfileType = type;
_profiles[path] = new Tuple<InternalProfileInfo, DeviceProfile>(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile);

View File

@ -1482,13 +1482,26 @@ namespace Emby.Server.Implementations
var assembly = plugin.GetType().Assembly;
var assemblyName = assembly.GetName();
var attribute = (GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
var assemblyId = new Guid(attribute.Value);
var assemblyFileName = assemblyName.Name + ".dll";
var assemblyFilePath = Path.Combine(ApplicationPaths.PluginsPath, assemblyFileName);
assemblyPlugin.SetAttributes(assemblyFilePath, assemblyFileName, assemblyName.Version, assemblyId);
assemblyPlugin.SetAttributes(assemblyFilePath, assemblyFileName, assemblyName.Version);
try
{
var idAttributes = assembly.GetCustomAttributes(typeof(GuidAttribute), true);
if (idAttributes.Length > 0)
{
var attribute = (GuidAttribute)idAttributes[0];
var assemblyId = new Guid(attribute.Value);
assemblyPlugin.SetId(assemblyId);
}
}
catch (Exception ex)
{
Logger.ErrorException("Error getting plugin Id from {0}.", ex, plugin.GetType().FullName);
}
}
var isFirstRun = !File.Exists(plugin.ConfigurationFilePath);

View File

@ -55,11 +55,15 @@ namespace MediaBrowser.Common.Plugins
get { return typeof(TConfigurationType); }
}
public void SetAttributes(string assemblyFilePath, string assemblyFileName, Version assemblyVersion, Guid assemblyId)
public void SetAttributes(string assemblyFilePath, string assemblyFileName, Version assemblyVersion)
{
AssemblyFilePath = assemblyFilePath;
AssemblyFileName = assemblyFileName;
Version = assemblyVersion;
}
public void SetId(Guid assemblyId)
{
Id = assemblyId;
}
@ -78,7 +82,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the unique id.
/// </summary>
/// <value>The unique id.</value>
public Guid Id { get; private set; }
public virtual Guid Id { get; private set; }
/// <summary>
/// Gets the plugin version
@ -284,6 +288,7 @@ namespace MediaBrowser.Common.Plugins
public interface IPluginAssembly
{
void SetAttributes(string assemblyFilePath, string assemblyFileName, Version assemblyVersion, Guid assemblyId);
void SetAttributes(string assemblyFilePath, string assemblyFileName, Version assemblyVersion);
void SetId(Guid assemblyId);
}
}

View File

@ -17,9 +17,6 @@ namespace MediaBrowser.Model.Dlna
[XmlIgnore]
public string Id { get; set; }
[XmlIgnore]
public MediaBrowser.Model.Dlna.DeviceProfileType ProfileType { get; set; }
/// <summary>
/// Gets or sets the identification.
/// </summary>

View File

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