Skip to content

Commit 6d80dca

Browse files
committed
Remove scheme
1 parent a40d2f2 commit 6d80dca

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ type Lidarr struct {
6767
LidarrDir string `env:"LIDARR_DIR" env-default:"/lidarr/"`
6868
MigrateDL bool `env:"MIGRATE_DOWNLOADS" env-default:"false"` // Move downloads from LidarrDir to DownloadDir
6969
Timeout int `env:"LIDARR_TIMEOUT" env-default:"20"`
70-
Scheme string `env:"LIDARR_SCHEME" env-default:"http"`
7170
URL string `env:"LIDARR_URL"`
7271
Filters Filters
7372
MonitorConfig LidarrMon

src/downloader/lidarr.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (c Lidarr) QueryTrack(track *models.Track) error {
207207
return err
208208
}
209209

210-
queryURL := fmt.Sprintf("%s://%s/api/v1/track?apiKey=%s&artistId=%v&albumId=%v", c.Cfg.Scheme, c.Cfg.URL, c.Cfg.APIKey, album.ArtistID, album.Releases[0].AlbumID)
210+
queryURL := fmt.Sprintf("%s/api/v1/track?apiKey=%s&artistId=%v&albumId=%v", c.Cfg.URL, c.Cfg.APIKey, album.ArtistID, album.Releases[0].AlbumID)
211211
body, err := c.HttpClient.MakeRequest("GET", queryURL, nil, nil)
212212
if err != nil {
213213
return fmt.Errorf("failed to check existing tracks: %w", err)
@@ -236,7 +236,7 @@ func (c Lidarr) GetTrack(track *models.Track) error {
236236
}
237237

238238
// Get the defaults from the root dir
239-
queryURL := fmt.Sprintf("%s://%s/api/v1/rootfolder?apiKey=%s", c.Cfg.Scheme, c.Cfg.URL, c.Cfg.APIKey)
239+
queryURL := fmt.Sprintf("%s/api/v1/rootfolder?apiKey=%s", c.Cfg.URL, c.Cfg.APIKey)
240240

241241
body, err := c.HttpClient.MakeRequest("GET", queryURL, nil, nil)
242242
if err != nil {
@@ -280,7 +280,7 @@ func (c Lidarr) GetTrack(track *models.Track) error {
280280
if err != nil {
281281
return fmt.Errorf("marshal error: %w", err)
282282
}
283-
queryURL = fmt.Sprintf("%s://%s/api/v1/album?apiKey=%s", c.Cfg.Scheme, c.Cfg.URL, c.Cfg.APIKey)
283+
queryURL = fmt.Sprintf("%s/api/v1/album?apiKey=%s", c.Cfg.URL, c.Cfg.APIKey)
284284
_, err = c.HttpClient.MakeRequest("POST", queryURL, bytes.NewReader(body), nil)
285285
if err != nil {
286286
return fmt.Errorf("failed to add album: %w", err)
@@ -290,7 +290,7 @@ func (c Lidarr) GetTrack(track *models.Track) error {
290290

291291
func (c Lidarr) findBestAlbumMatch(track *models.Track) (*Album, error) {
292292
escQuery := url.PathEscape(fmt.Sprintf("%s - %s", track.Album, track.MainArtist))
293-
queryURL := fmt.Sprintf("%s://%s/api/v1/album/lookup?apiKey=%s&term=%s", c.Cfg.Scheme, c.Cfg.URL, c.Cfg.APIKey, escQuery)
293+
queryURL := fmt.Sprintf("%s/api/v1/album/lookup?apiKey=%s&term=%s", c.Cfg.URL, c.Cfg.APIKey, escQuery)
294294

295295
body, err := c.HttpClient.MakeRequest("GET", queryURL, nil, nil)
296296
if err != nil {
@@ -388,10 +388,10 @@ func (c Lidarr) deleteDownload(user, ID string) error {
388388

389389
func (c *Lidarr) Cleanup(track models.Track, fileID string) error {
390390
if err := c.deleteSearch(track.ID); err != nil {
391-
slog.Debug(fmt.Sprintf("[slskd] failed to delete search request: %v", err))
391+
slog.Debug(fmt.Sprintf("[lidarr] failed to delete search request: %v", err))
392392
}
393393
if err := c.deleteDownload(track.MainArtistID, fileID); err != nil {
394-
slog.Debug(fmt.Sprintf("[slskd] failed to delete download: %v", err))
394+
slog.Debug(fmt.Sprintf("[lidarr] failed to delete download: %v", err))
395395
}
396396
return nil
397397
}

0 commit comments

Comments
 (0)