From 4bdb7a9fd47dde61982f71602d8e089e19b7959b Mon Sep 17 00:00:00 2001 From: kaso17 Date: Mon, 6 Mar 2017 14:05:11 +0100 Subject: [PATCH] Cardigann: add support for multiple search files with the same key --- src/Jackett/Indexers/CardigannIndexer.cs | 57 +++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/src/Jackett/Indexers/CardigannIndexer.cs b/src/Jackett/Indexers/CardigannIndexer.cs index a995a9dd4..e8e1895d8 100644 --- a/src/Jackett/Indexers/CardigannIndexer.cs +++ b/src/Jackett/Indexers/CardigannIndexer.cs @@ -36,7 +36,60 @@ namespace Jackett.Indexers get { return (ConfigurationData)base.configData; } set { base.configData = value; } } - + + // A Dictionary allowing the same key multiple times + public class KeyValuePairList : List>, IDictionary + { + public selectorBlock this[string key] + { + get + { + throw new NotImplementedException(); + } + + set + { + base.Add(new KeyValuePair(key, value)); + } + } + + public ICollection Keys + { + get + { + throw new NotImplementedException(); + } + } + + public ICollection Values + { + get + { + throw new NotImplementedException(); + } + } + + public void Add(string key, selectorBlock value) + { + base.Add(new KeyValuePair(key, value)); + } + + public bool ContainsKey(string key) + { + throw new NotImplementedException(); + } + + public bool Remove(string key) + { + throw new NotImplementedException(); + } + + public bool TryGetValue(string key, out selectorBlock value) + { + throw new NotImplementedException(); + } + } + // Cardigann yaml classes public class IndexerDefinition { public string Site { get; set; } @@ -140,7 +193,7 @@ namespace Jackett.Indexers public List Keywordsfilters { get; set; } public Dictionary Inputs { get; set; } public rowsBlock Rows { get; set; } - public Dictionary Fields { get; set; } + public KeyValuePairList Fields { get; set; } } public class rowsBlock : selectorBlock