Skip to content

Commit 289f12f

Browse files
committedJan 28, 2025
fixed some small issues
1 parent 2c11bca commit 289f12f

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed
 

‎backend/indexers/gazelle.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ func ConstructRequestGazelle(prowlarrIndexerConfig gjson.Result, indexerName str
1515
baseUrl := prowlarrIndexerConfig.Get("baseUrl").Str
1616
var apiUrl string
1717
if indexerName == "GazelleGames" {
18-
apiUrl = "api.php?request="
18+
apiUrl = baseUrl + "api.php?request="
1919
} else {
20-
apiUrl = "ajax.php?action="
20+
apiUrl = baseUrl + "ajax.php?action="
2121
}
2222

2323
var req *http.Request
@@ -61,7 +61,7 @@ func ProcessIndexerResponseGazelle(results gjson.Result, indexerInfoJson gjson.R
6161
}
6262

6363
func getUserIdGazelle(baseUrl string, apiKey string, indexerName string) int64 {
64-
req, _ := http.NewRequest("", "", nil)
64+
var req *http.Request
6565
if indexerName == "GazelleGames" {
6666
req, _ = http.NewRequest("GET", baseUrl+"quick_user", nil)
6767
req.Header.Add("X-API-Key", apiKey)
@@ -79,7 +79,6 @@ func getUserIdGazelle(baseUrl string, apiKey string, indexerName string) int64 {
7979

8080
body, _ := io.ReadAll(resp.Body)
8181
if resp.Status == "200 OK" {
82-
// fmt.Println(string(body))
8382
return gjson.Get(string(body), "response.id").Int()
8483
} else {
8584
return -1

‎backend/indexers/getUserData.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package indexers
33
import (
44
"errors"
55
"fmt"
6+
"io"
67
"log"
78
"net/http"
89

@@ -30,7 +31,9 @@ func GetUserData(prowlarrIndexerConfig gjson.Result, indexerName string, indexer
3031
results = ProcessIndexerResponse(resp, indexerName)
3132
return results, nil
3233
} else {
33-
fmt.Println(resp.Status)
34+
35+
body, _ := io.ReadAll(resp.Body)
36+
fmt.Println(string(body))
3437
fmt.Printf("Indexer %s did not reply with status 200 OK, skipping.", indexerName)
3538
// fmt.Println(resp)
3639
return map[string]interface{}{}, errors.New("An error occured when getting indexer's data")

‎frontend/src/components/settings/IndexerSettings.vue

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div id="indexer-settings">
33
<div class="note">Indexers need to be setup in Prowlarr first in order to work with Dasharr, even if the credentials from Prowlarr are not used</div>
4+
<div class="note">Make sure the API keys configured in prowlarr have access to user stats</div>
45
<div class="note">Enabling/disabling an indexer here will only affect its visibility on the dashboard, data will always be collected if it is enabled in config.json</div>
56
<Card v-tooltip.top="{ value: 'To display this indexer in the dashboard, first enable it in config.json', disabled: indexer['enabled'] }" v-for="indexer in indexersConfig" :key="indexer['indexer_name']" :class="{ disabled: !indexer['enabled'], 'indexer-card': true }">
67
<template #content>

0 commit comments

Comments
 (0)
Please sign in to comment.