Luke Pulverenti 7 years ago
parent
commit
780b761456

+ 0 - 1
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<InternalProfileInfo, DeviceProfile>(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile);
 

+ 17 - 4
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);

+ 8 - 3
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.
         /// </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);
     }
 }

+ 0 - 3
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; }
-
         /// <summary>
         /// Gets or sets the identification.
         /// </summary>

+ 1 - 1
SharedVersion.cs

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