From 37adca95f88e94fdf0e9e2ee5f180561d28f7d47 Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Tue, 25 May 2021 06:37:59 -0500 Subject: [PATCH] fixing sprintf --- pkg/eraser/eraser.go | 2 +- pkg/locator/locator.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/eraser/eraser.go b/pkg/eraser/eraser.go index 3203133..dc1701e 100644 --- a/pkg/eraser/eraser.go +++ b/pkg/eraser/eraser.go @@ -95,7 +95,7 @@ func LookupTVFileLocation(config config.Config, ids []int) []string { func DeleteSeriesFromSonarr(config config.Config, ids []int) { for _, i := range ids { - sonarrURL := fmt.Sprintf("%s%s%s%d%s%s", config.SonarrURL, "/api/series/", i, "/?deleteFiles=true&apikey=", config.SonarrAPIKey) + sonarrURL := fmt.Sprintf("%s%s%d%s%s", config.SonarrURL, "/api/series/", i, "/?deleteFiles=true&apikey=", config.SonarrAPIKey) req, err := http.NewRequest(http.MethodDelete, sonarrURL, nil) if err != nil { log.Fatal(err) diff --git a/pkg/locator/locator.go b/pkg/locator/locator.go index f29d8cd..04e5797 100644 --- a/pkg/locator/locator.go +++ b/pkg/locator/locator.go @@ -56,7 +56,7 @@ func GetLibraryType(config config.Config, sectionID int) string { // GetCount will gather a count of media in a specific library, required for GetTitles. func GetCount(config config.Config, sectionID int) int { - countURL := fmt.Sprintf("%s%s%s%s%s%d", config.PlexPyURL, "/api/v2?apikey=", config.PlexPyAPIKey, "&cmd=get_library§ion_id=", sectionID) + countURL := fmt.Sprintf("%s%s%s%s%d", config.PlexPyURL, "/api/v2?apikey=", config.PlexPyAPIKey, "&cmd=get_library§ion_id=", sectionID) req, err := http.NewRequest(http.MethodGet, countURL, nil) if err != nil { log.Fatal(err) @@ -90,7 +90,7 @@ func GetCount(config config.Config, sectionID int) int { func GetTitles(config config.Config, sectionID int, days int) ([]int, []string) { count := GetCount(config, sectionID) - titlesURL := fmt.Sprintf("%s%s%s%s%s%d%s%d", config.PlexPyURL, "/api/v2?apikey=", config.PlexPyAPIKey, "&cmd=get_library_media_info§ion_id=", sectionID, "&order_column=last_played&refresh=true&order_dir=asc&length=", count) + titlesURL := fmt.Sprintf("%s%s%s%s%d%s%d", config.PlexPyURL, "/api/v2?apikey=", config.PlexPyAPIKey, "&cmd=get_library_media_info§ion_id=", sectionID, "&order_column=last_played&refresh=true&order_dir=asc&length=", count) req, err := http.NewRequest(http.MethodGet, titlesURL, nil) if err != nil { @@ -162,7 +162,7 @@ func GetTitles(config config.Config, sectionID int, days int) ([]int, []string) // GetSonarrIDs gets the IDs to delete from the title list in PlexPy. func GetSonarrIDs(config config.Config, titles []string) []int { ids := make([]int, 0) - sonarrURL := fmt.Sprintf("%s%s%s%s", config.SonarrURL, "/api/series?apikey=", config.SonarrAPIKey) + sonarrURL := fmt.Sprintf("%s%s%s", config.SonarrURL, "/api/series?apikey=", config.SonarrAPIKey) req, err := http.NewRequest(http.MethodGet, sonarrURL, nil) if err != nil { log.Fatal(err)