mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(actions): cross platform watch dir file handling (#458)
* chore: update deps * fix(actions): cross-platform file handling * fix(qbittorrent): unrelated failing test
This commit is contained in:
parent
8b96f29f37
commit
bbb8d2fe6e
22 changed files with 129 additions and 123 deletions
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -203,7 +203,7 @@ func (c *client) GetTorrentByID(torrentID string) (*domain.TorrentBasic, error)
|
|||
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, readErr := ioutil.ReadAll(resp.Body)
|
||||
body, readErr := io.ReadAll(resp.Body)
|
||||
if readErr != nil {
|
||||
return nil, errors.Wrap(readErr, "error reading body")
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package ggn
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -29,7 +29,7 @@ func Test_client_GetTorrentByID(t *testing.T) {
|
|||
}
|
||||
|
||||
if !strings.Contains(r.RequestURI, "422368") {
|
||||
jsonPayload, _ := ioutil.ReadFile("testdata/ggn_get_torrent_by_id_not_found.json")
|
||||
jsonPayload, _ := os.ReadFile("testdata/ggn_get_torrent_by_id_not_found.json")
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(jsonPayload)
|
||||
|
@ -37,7 +37,7 @@ func Test_client_GetTorrentByID(t *testing.T) {
|
|||
}
|
||||
|
||||
// read json response
|
||||
jsonPayload, _ := ioutil.ReadFile("testdata/ggn_get_torrent_by_id.json")
|
||||
jsonPayload, _ := os.ReadFile("testdata/ggn_get_torrent_by_id.json")
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(jsonPayload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue