diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs index 847f636198..4ff413b9bd 100644 --- a/Emby.Dlna/DlnaManager.cs +++ b/Emby.Dlna/DlnaManager.cs @@ -316,7 +316,6 @@ namespace Emby.Dlna profile = ReserializeProfile(tempProfile); profile.Id = path.ToLower().GetMD5().ToString("N"); - profile.ProfileType = type; _profiles[path] = new Tuple(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile); diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 70ec37a3bc..3454451022 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -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); diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs index 95e076096c..73be04ac88 100644 --- a/MediaBrowser.Common/Plugins/BasePlugin.cs +++ b/MediaBrowser.Common/Plugins/BasePlugin.cs @@ -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. /// /// The unique id. - public Guid Id { get; private set; } + public virtual Guid Id { get; private set; } /// /// 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); } } diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index d6f0eafc75..fc976b6052 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -17,9 +17,6 @@ namespace MediaBrowser.Model.Dlna [XmlIgnore] public string Id { get; set; } - [XmlIgnore] - public MediaBrowser.Model.Dlna.DeviceProfileType ProfileType { get; set; } - /// /// Gets or sets the identification. /// diff --git a/SharedVersion.cs b/SharedVersion.cs index f946267ea3..1fbacc73d4 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.29.1")] +[assembly: AssemblyVersion("3.2.29.2")]