Commit Graph

42 Commits

Author SHA1 Message Date
chibidev bcc1e5ff6c Fix OMDB key handling (#1581) 2017-07-21 17:56:29 +02:00
chibidev 7c2b801ee9 Feature/remove autofac from indexer manager (#1549)
* Line endings...

* Remove Autofac and all its shenanigans from IndexerManager

I'm starting my warpath against Autofac. For the next couple PRs I want
to focus on refactoring things rather than creating new things. This
includes introducing LINQ extensions wherever possible as well as
removing Autofac/Automapper dependencies in classes (or any other
dependency, there's a great chance that most of the classes that use
Jackett.Services wouldn't need so many of them). All this is order to
boost performance and eventually reach testability. Can't stop, won't
stop.

* Remove unnecessary extension

* Modify test project

* As per @kaso17, iterating through iterator types rather than allocating them manually

* Cleaning up a little

* Adjusting interface in tests
2017-07-14 07:39:52 +02:00
kaso17 fb59e84def Fix autofac exception 2017-07-11 22:17:56 +02:00
chibidev 9e3076dde6 I have a feeling I'm breaking the world and bringing the apocalypse
It's quite hard to encapsulate something this large. This refactor
contains multiple attacks on the current architecture and is changing
things that were probably created quite a while back then. Luckily this
was done in increments so it mustn't be that impossible to recall what
has been done. I just need to relax my memory a little bit.

So the basic idea was quite simple. Let's distingush metas and normal
indexers a little bit more. Both of them were originating from
BaseIndexer, however very little of the functionality was actually
shared between them. Actually quite a few things made it even harder to
implement a different kind of indexer, especially for a newcomer for
both Jackett and C#.

Then in order to further reduce whatever was encapsulated in
any kind of, a couple things had to be changed. Like CardigannIndexer,
which probably had quite a mindshift change. IndexerManager and the
configuration management were also encapsulated and refactored, and now
I have a feeling that although the code could be improved, at least the
responsibilities of services and what they actually do is now clearer.

Anyhow, it would be safe to assume that I will not be able to go
step-by-step and define everything that has been changed. I'm sorry.
2017-07-11 21:53:46 +02:00
chibidev 4a0d2dcc57 Feature/metaindexer torrent download improvement (#1517)
* Line endings...

* Improve download handling of torrents in metas

Until now, downloads were handled by metas, however they had to "guess"
which indexer the result was originating from and resolve to that
indexer. While this has been working without an issue, it really
shouldn't be considered stable.

Therefore indexers now link themselves to the results they provide. In
order to keep my sanity and automate this as much as possible, I had to
slightly modify the interface (sorry, everyone).
2017-07-03 07:15:47 +02:00
chibidev 91eae526f9 Bugfix/1404 fix potato search (#1516)
* Line endings...

* Integrating OMDB into Potato results

Now PotatoController will actually produce results

* VS complains it could be simplified, yet AppVeyor cannot do anything with it...

* How come only Appveyor unveils this error? @drunkvs
2017-07-01 18:23:57 +02:00
chibidev 75e7ce81c2 Feature/omdb api integration (#1509)
* Line endings...

* Refactoring how MetaIndexers handle fallbacks

Originally this modification was part of a much larger refactoring,
however for the sake of reviewability I split it into smaller chunks.
Sadly it is still quite large.
I wanted to split it even more, however after a certain point there was
really no value in creating smaller chunks. The biggest part of this
modification would be still huge.

So all in all, there're 3 aspects of this modification
- It modifies BaseIndexer so that it now implements IIndexer (will be
very useful later on)
- Resolving most of the warnings currently in Jackett (the only ones
remaining are related to Autofac, however if I could I would just burn
Autofac altogether rather than fix the warnings. Will open discussion on
this.)
- Biggest part: refactoring how MetaIndexers handle fallbacks and how
they provide the final result set

MetaIndexers now accept any kind of fallback and filtering mechanism
that implements the necessary interface, so that in the future IMDB
fallback and filtering won't be the only one. I know there are not a lot
of unit tests around Jackett at the moment, however this renders the
class much more unittestable as well.

* Integrate OMDB API for the fallback option

* Safeguarding when no API key is specified

* Autofac started complaining... I don't understand...

* How did that not make the previous commit?
2017-06-29 07:53:25 +02:00
chibidev 345602926e Feature/cleaning up aggregate indexer fallback (#1507)
* Line endings...

* Refactoring how MetaIndexers handle fallbacks

Originally this modification was part of a much larger refactoring,
however for the sake of reviewability I split it into smaller chunks.
Sadly it is still quite large.
I wanted to split it even more, however after a certain point there was
really no value in creating smaller chunks. The biggest part of this
modification would be still huge.

So all in all, there're 3 aspects of this modification
- It modifies BaseIndexer so that it now implements IIndexer (will be
very useful later on)
- Resolving most of the warnings currently in Jackett (the only ones
remaining are related to Autofac, however if I could I would just burn
Autofac altogether rather than fix the warnings. Will open discussion on
this.)
- Biggest part: refactoring how MetaIndexers handle fallbacks and how
they provide the final result set

MetaIndexers now accept any kind of fallback and filtering mechanism
that implements the necessary interface, so that in the future IMDB
fallback and filtering won't be the only one. I know there are not a lot
of unit tests around Jackett at the moment, however this renders the
class much more unittestable as well.

* Autofac started complaining... I don't understand...
2017-06-28 07:31:38 +02:00
chibidev 3b4eceed87 Feature/improved aggregate results (#1432)
* Line endings...

* Add fallback query for meta indexers

In cases where multiple indexers are configured under one
metaindexer if any of them supports IMDB search the meta
will support IMDB search as well. However the actual query will
then only be performed by those supporting IMDB search, because
others refuse it (see CanHandleQuery implementation).
- This adds support of a fallback mechanism for other indexers
- Adds first implementation of result improvement (necessary for
  fallback queries as they might produce irrelevant results)
- Some minor fixes encountered while debugging/coding

Known issue:
- Configuring nCore and IsoHunt together will render results
  from nCore unusuable. Don't know why.
2017-06-03 15:04:51 +02:00
chibidev 27d4f2108e Feature/aggregate performance improvement (#1349)
* Checking capabilities before executing a query

* Introduce base class for meta indexers

* Build fix - I seriously do not know how I missed that

* Moving things to the appropriate place

* Simplifying things as much as possible and moving once again

* Build fix?
2017-05-14 18:55:36 +02:00
chibidev 251a631523 Bugfix/aggregate indexer radarr compatibility (#1333)
* Improving Torznab compatibility in AggregateIndexer

The indexer was not correctly reporting the Torznab capabilities
it provided. Basically it only reported a default number of
caps instead of combining all the caps of all the configured
indexers. This lead to an issue with external components
(e.g. Radarr) which rendered the Aggregate feed unusable in
certain situations.
- Correctly reports capabilities based on configured indexers

* Fixes incorrect internal state of configured indexers

When adding/deleting configured indexers the aggregate
was never updated leaving out possible search results.
- Introduce reconfiguring of the Aggregate upon addition/deletion
 of an indexer
- Fixing an internal state issue of the indexers reporting
 themselves as unconfigured after addition

* Removing obsolete call (thanks @kaso17)
2017-05-07 09:10:57 +02:00
chibidev b942689dad Fixing a bunch of issues with the newly added AggregateIndexer (#1324)
This patch improves the general stability of the aggregate.
- Result is generated even if some trackers failed to answer
  or some other issue were encountered
- Fixes Jackett/Jackett#1316
2017-05-04 21:46:39 +02:00
chibidev c0b665062e Adding an aggregate torznab feed for all configured trackers (#1312)
* Adding an aggregate torznab feed for all configured trackers

This adds just a basic first implementation of a special
torznab feed that will make all configured trackers available
with all the supported query params.
- This should close #1247 
- This also contributes to #921 

* Adding missing file

* Add missing implementation from Test project
2017-04-30 10:06:29 +02:00
flightlevel f2def1f615 Normalise Line endings (#1284)
* Add .gitattributes

* Normalise line endings
2017-04-15 18:45:10 +10:00
kaso17 8e5538a11e Avoid concurrent config file writes 2017-01-05 18:08:10 +01:00
kaso17 175bea9269 Automatically load the backup config if the primary one is corrupted 2017-01-05 18:05:14 +01:00
kaso17 2ffdc1678b Make Cardigann indexers deletable 2016-12-10 18:20:04 +01:00
kaso17 67bf46ccb6 TorznabQuery: add IsTest flag 2016-12-06 18:24:40 +01:00
kaso17 412df7c6f6 Sort indexers once all are loaded 2016-12-05 13:03:30 +01:00
kaso17 5922795587 Fix NULL check for #668 (#672) 2016-11-10 09:16:00 +01:00
kaso17 5eccf08690 IIndexerManagerService: fix typo (#671) 2016-11-10 09:10:16 +01:00
kaso17 037d907028 Make the config saving process more robust (#670) 2016-11-10 09:06:35 +01:00
kaso17 8c1086719d Improve error handling on corrupt indexer config files (#624) 2016-11-01 23:13:59 +01:00
kaso17 0f5e18492c Load definitions from multiple directories 2016-10-30 19:46:50 +01:00
kaso17 2b9b4282f4 Gracefully fail on Cardigann definitions Exceptions (#595) 2016-10-29 18:01:43 +02:00
kaso17 21cffe2d35 Add basic support for Cardigann definitions (#571)
* Add basic support for Cardigann definitions

* Add HDME definition

* Fix tests

* support split with negative indexes

* allow FromTimeAgo formats without spaces betwen value and unit

Example: 2h 3m

* Add basic support for Cardigann definitions

* Add HDME definition

* Fix tests

* support split with negative indexes

* allow FromTimeAgo formats without spaces betwen value and unit

Example: 2h 3m
2016-10-27 18:30:03 +11:00
KZ e660c57ccb Category mapping on TorrentLeech and AnimeBytes. Fix sparadic issue where downloads fail due to the url being too long. 2015-08-13 22:51:49 +01:00
KZ bcc0b5b6bf Fix Safari not working not working (Untested). Fix cached download links not proxying the torrent download. 2015-08-05 23:00:09 +01:00
unknown 0a8d9d3447 Abstracted & unified indexer config logic (logins are now saved), implemented indexer config migrations, fixed nCore implementation 2015-08-03 15:38:45 -06:00
KZ d3e43b290f Upgrade fix and testing an indexer now adds to the cache 2015-07-29 00:56:08 +01:00
KZ ea069810a5 Add indexer: Immortalseed. Add category mapping framework. 2015-07-29 00:10:04 +01:00
KZ 499b53e9ed Post refactor fixes 2015-07-28 20:22:23 +01:00
KZ 1622f40942 Passwords inputs are now the correct type. Fix configure_indexer not returning errors. Fix build warning. Change AB, HDT, MTTV, PHD, ST to use generic web client. 2015-07-23 21:36:23 +01:00
KZ 7f53c52767 Fix trackers with non alphanumerics in the name not resolving 2015-07-22 23:06:46 +01:00
unknown 63ba324281 Fixed indexer register by name 2015-07-19 13:38:41 -06:00
unknown 195ec0a94c Indexer ID rather than class name 2015-07-19 13:28:08 -06:00
unknown c39feb7997 Fixed TestIndexer async Task 2015-07-19 12:25:47 -06:00
unknown c92caf18c5 Fix indexer class lookup by string when name has non-alphanumeric chars 2015-07-19 11:37:08 -06:00
KZ 75f0cce064 Change indexers to use new api 2015-07-19 18:18:54 +01:00
KZ 1359ad16f0 Refactor done 2015-07-19 14:22:50 +01:00
KZ e518a3b58e Interim commit 2015-07-19 01:59:30 +01:00
KZ 33a97b148f Refactor 2015-07-19 01:27:41 +01:00