2017-10-29 06:21:18 +00:00
|
|
|
|
using System;
|
2015-04-13 06:25:21 +00:00
|
|
|
|
using System.Collections.Generic;
|
2018-06-15 09:12:03 +00:00
|
|
|
|
using System.Text;
|
2015-04-13 06:25:21 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2018-03-10 08:05:56 +00:00
|
|
|
|
using Jackett.Common.Models;
|
|
|
|
|
using Jackett.Common.Models.IndexerConfig;
|
2017-10-29 06:21:18 +00:00
|
|
|
|
using Newtonsoft.Json.Linq;
|
2015-04-13 06:25:21 +00:00
|
|
|
|
|
2018-03-10 08:05:56 +00:00
|
|
|
|
namespace Jackett.Common.Indexers
|
2015-04-13 06:25:21 +00:00
|
|
|
|
{
|
2017-08-24 10:28:41 +00:00
|
|
|
|
public class IndexerResult
|
|
|
|
|
{
|
|
|
|
|
public IIndexer Indexer { get; set; }
|
|
|
|
|
public IEnumerable<ReleaseInfo> Releases { get; set; }
|
|
|
|
|
|
|
|
|
|
public IndexerResult(IIndexer Indexer, IEnumerable<ReleaseInfo> Releases)
|
|
|
|
|
{
|
|
|
|
|
this.Indexer = Indexer;
|
|
|
|
|
this.Releases = Releases;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-19 13:22:50 +00:00
|
|
|
|
public interface IIndexer
|
2015-04-13 06:25:21 +00:00
|
|
|
|
{
|
2015-07-27 00:03:51 +00:00
|
|
|
|
string SiteLink { get; }
|
2017-01-02 20:39:28 +00:00
|
|
|
|
string[] AlternativeSiteLinks { get; }
|
2015-07-27 00:03:51 +00:00
|
|
|
|
|
2015-04-13 14:25:41 +00:00
|
|
|
|
string DisplayName { get; }
|
|
|
|
|
string DisplayDescription { get; }
|
2017-01-27 15:57:32 +00:00
|
|
|
|
string Type { get; }
|
2016-12-02 17:58:10 +00:00
|
|
|
|
string Language { get; }
|
2016-12-05 10:43:07 +00:00
|
|
|
|
string LastError { get; set; }
|
2015-07-19 19:28:08 +00:00
|
|
|
|
string ID { get; }
|
2018-06-15 09:12:03 +00:00
|
|
|
|
Encoding Encoding { get; }
|
2015-07-19 19:28:08 +00:00
|
|
|
|
|
2015-07-19 23:05:30 +00:00
|
|
|
|
TorznabCapabilities TorznabCaps { get; }
|
2015-07-18 20:35:02 +00:00
|
|
|
|
|
2015-04-25 19:37:03 +00:00
|
|
|
|
// Whether this indexer has been configured, verified and saved in the past and has the settings required for functioning
|
2017-04-15 08:45:10 +00:00
|
|
|
|
bool IsConfigured { get; }
|
|
|
|
|
|
|
|
|
|
// Retrieved for starting setup for the indexer via web API
|
2015-04-13 06:25:21 +00:00
|
|
|
|
Task<ConfigurationData> GetConfigurationForSetup();
|
|
|
|
|
|
|
|
|
|
// Called when web API wants to apply setup configuration via web API, usually this is where login and storing cookie happens
|
2015-08-22 20:57:13 +00:00
|
|
|
|
Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson);
|
2015-04-13 06:25:21 +00:00
|
|
|
|
|
|
|
|
|
// Called on startup when initializing indexers from saved configuration
|
|
|
|
|
void LoadFromSavedConfiguration(JToken jsonConfig);
|
2017-10-29 06:21:18 +00:00
|
|
|
|
|
2017-01-05 17:05:14 +00:00
|
|
|
|
void SaveConfig();
|
2015-04-16 06:04:28 +00:00
|
|
|
|
|
2017-07-10 20:58:44 +00:00
|
|
|
|
void Unconfigure();
|
|
|
|
|
|
2017-08-24 10:28:41 +00:00
|
|
|
|
Task<IndexerResult> ResultsForQuery(TorznabQuery query);
|
2015-07-28 23:10:04 +00:00
|
|
|
|
|
2017-07-10 20:58:44 +00:00
|
|
|
|
bool CanHandleQuery(TorznabQuery query);
|
|
|
|
|
}
|
2015-04-17 03:53:52 +00:00
|
|
|
|
|
2017-07-10 20:58:44 +00:00
|
|
|
|
public interface IWebIndexer : IIndexer
|
|
|
|
|
{
|
2015-04-17 03:53:52 +00:00
|
|
|
|
Task<byte[]> Download(Uri link);
|
2015-04-13 06:25:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|