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?
This commit is contained in:
chibidev
2017-06-29 07:53:25 +02:00
committed by kaso17
parent 345602926e
commit 75e7ce81c2
7 changed files with 1208 additions and 1218 deletions

View File

@@ -332,7 +332,7 @@ namespace Jackett.Controllers
cfg["password"] = string.IsNullOrEmpty(serverService.Config.AdminPassword) ? string.Empty : serverService.Config.AdminPassword.Substring(0, 10);
cfg["logging"] = Startup.TracingEnabled;
cfg["basepathoverride"] = serverService.Config.BasePathOverride;
cfg["omdbkey"] = serverService.Config.OmdbApiKey;
jsonReply["config"] = cfg;
jsonReply["app_version"] = config.GetVersion();
@@ -364,10 +364,12 @@ namespace Jackett.Controllers
bool preRelease = (bool)postData["prerelease"];
bool logging = (bool)postData["logging"];
string basePathOverride = (string)postData["basepathoverride"];
string omdbApiKey = (string)postData["omdbkey"];
Engine.Server.Config.UpdateDisabled = updateDisabled;
Engine.Server.Config.UpdatePrerelease = preRelease;
Engine.Server.Config.BasePathOverride = basePathOverride;
Engine.Server.Config.OmdbApiKey = omdbApiKey;
Startup.BasePath = Engine.Server.BasePath();
Engine.Server.SaveConfig();