From eec07bc5b84acd399e602205ffeb6dcba7548724 Mon Sep 17 00:00:00 2001 From: chibidev Date: Sat, 12 Aug 2017 01:04:30 +0200 Subject: [PATCH] Fix manual search - append apikey --- src/Jackett/Content/custom.js | 2 ++ src/Jackett/Content/libs/api.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Jackett/Content/custom.js b/src/Jackett/Content/custom.js index c7e350939..375f0c18e 100644 --- a/src/Jackett/Content/custom.js +++ b/src/Jackett/Content/custom.js @@ -70,6 +70,8 @@ function loadJackettSettings() { basePath = ''; } + api.key = data.api_key; + $("#jackett-savedir").val(data.blackholedir); $("#jackett-allowext").attr('checked', data.external); $("#jackett-allowupdate").attr('checked', data.updatedisabled); diff --git a/src/Jackett/Content/libs/api.js b/src/Jackett/Content/libs/api.js index 681d5879a..9ab8c185e 100644 --- a/src/Jackett/Content/libs/api.js +++ b/src/Jackett/Content/libs/api.js @@ -1,6 +1,7 @@ var api = { version: "2.0", root: "/api", + key: "", getApiPath: function(category, action) { var path = this.root + "/v" + this.version + "/" + category; @@ -47,7 +48,7 @@ var api = { }, resultsForIndexer: function(indexerId, query, callback) { - return $.get(this.getApiPath("indexers", indexerId + "/results"), query, callback); + return $.get(this.getApiPath("indexers", indexerId + "/results?apikey=" + this.key), query, callback); }, getServerCache: function(callback) {