0.2.55 - Remote config/Request fixes

This commit is contained in:
ponzischeme89
2026-08-12 09:57:56 +12:00
parent 4b31946635
commit 9777eb0952
35 changed files with 1086 additions and 78 deletions
+9 -9
View File
@@ -46,7 +46,7 @@ func TestCalendarUsesV3APIAndKeepsKeyInHeader(t *testing.T) {
}
}
func TestAddUnmonitoredUsesDefaultsWithoutStartingSearch(t *testing.T) {
func TestAddRequestedUsesDefaultsAndStartsSearch(t *testing.T) {
upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/api/v3/rootfolder":
@@ -58,17 +58,17 @@ func TestAddUnmonitoredUsesDefaultsWithoutStartingSearch(t *testing.T) {
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
t.Fatal(err)
}
if body["monitored"] != false || body["seasonFolder"] != true ||
if body["monitored"] != true || body["seasonFolder"] != true ||
body["rootFolderPath"] != "/tv" || body["qualityProfileId"] != float64(3) {
t.Errorf("unexpected add body: %#v", body)
}
seasons := body["seasons"].([]any)
if seasons[0].(map[string]any)["monitored"] != false {
t.Errorf("season remained monitored: %#v", body)
if seasons[0].(map[string]any)["monitored"] != true {
t.Errorf("season was not monitored: %#v", body)
}
options := body["addOptions"].(map[string]any)
if options["searchForMissingEpisodes"] != false {
t.Errorf("episode search was enabled: %#v", body)
if options["searchForMissingEpisodes"] != true {
t.Errorf("episode search was not enabled: %#v", body)
}
_, _ = w.Write([]byte(`{"id":8,"tvdbId":44,"title":"Severance"}`))
default:
@@ -77,10 +77,10 @@ func TestAddUnmonitoredUsesDefaultsWithoutStartingSearch(t *testing.T) {
}))
defer upstream.Close()
added, err := New(upstream.URL, "secret", time.Second).AddUnmonitored(
added, err := New(upstream.URL, "secret", time.Second).AddRequested(
context.Background(), Series{
TVDBID: 44, Title: "Severance", Monitored: true,
Seasons: []Season{{SeasonNumber: 1, Monitored: true}},
TVDBID: 44, Title: "Severance",
Seasons: []Season{{SeasonNumber: 1}},
},
)
if err != nil {