diff --git a/Kyoo.Common/Models/Attributes/FileSystemMetadataAttribute.cs b/Kyoo.Common/Models/Attributes/FileSystemMetadataAttribute.cs index 464c44d0..d2b997a5 100644 --- a/Kyoo.Common/Models/Attributes/FileSystemMetadataAttribute.cs +++ b/Kyoo.Common/Models/Attributes/FileSystemMetadataAttribute.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.ComponentModel.Composition; using Kyoo.Controllers; @@ -27,9 +28,26 @@ namespace Kyoo.Common.Models.Attributes public bool StripScheme { get; set; } + /// + /// Create a new using the specified schemes. + /// + /// The schemes to use. public FileSystemMetadataAttribute(string[] schemes) { Scheme = schemes; } + + /// + /// Create a new using a dictionary of metadata. + /// + /// + /// The dictionary of metadata. This method expect the dictionary to contain a field + /// per property in this attribute, with the same types as the properties of this attribute. + /// + public FileSystemMetadataAttribute(IDictionary metadata) + { + Scheme = (string[])metadata[nameof(Scheme)]; + StripScheme = (bool)metadata[nameof(StripScheme)]; + } } } \ No newline at end of file