浏览代码

Add escape hatch for Series merging
This is an universal solution for plugins to override how series are merged.
The reason to override is so we can set the same provider id on multiple items without merging them, while using another id for merging them. Having an (optional) provider id not tied to any online database allows plugins to use their own rules for merging series.

Mikal Stordal 3 年之前
父节点
当前提交
8e1796f08a
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 5 0
      MediaBrowser.Controller/Entities/TV/Series.cs
  2. 6 0
      MediaBrowser.Model/Entities/MetadataProvider.cs

+ 5 - 0
MediaBrowser.Controller/Entities/TV/Series.cs

@@ -184,6 +184,11 @@ namespace MediaBrowser.Controller.Entities.TV
                 list.Insert(0, key);
             }
 
+            if (this.TryGetProviderId(MetadataProvider.Custom, out key))
+            {
+                list.Insert(0, key);
+            }
+
             return list;
         }
 

+ 6 - 0
MediaBrowser.Model/Entities/MetadataProvider.cs

@@ -7,6 +7,12 @@ namespace MediaBrowser.Model.Entities
     /// </summary>
     public enum MetadataProvider
     {
+        /// <summary>
+        /// This metadata provider is for users and/or plugins to override the
+        /// default merging behaviour.
+        /// </summary>
+        Custom = 0,
+
         /// <summary>
         /// The imdb.
         /// </summary>