Skip to content

Commit c3583bf

Browse files
committed
Update sample env; reorganize
1 parent 32c26ef commit c3583bf

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

sample.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ YOUTUBE_API_KEY=
6969
# Minimal Bitrate (default: 256)
7070
# MIN_BITRATE=256
7171

72+
# === Lidarr Configuration ===
73+
74+
# LIDARR_API_KEY=
75+
# LIDARR_RETRY=
76+
# LIDARR_DL_ATTEMPTS=
77+
# LIDARR_DIR=
78+
# MIGRATE_DOWNLOADS=
79+
# LIDARR_TIMEOUT=
80+
# LIDARR_SCHEME=
81+
# LIDARR_URL=
82+
7283
# === Metadata / Formatting ===
7384

7485
# Set to true to merge featured artists into title (recommended), false appends them to artist field (default: true)

src/downloader/lidarr.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,21 @@ func (c Lidarr) findBestAlbumMatch(track *models.Track) (*Album, error) {
301301
return &topMatch, nil
302302
}
303303

304+
func (c Lidarr) getDownloadStatus() (DownloadStatus, error) {
305+
reqParams := "/api/v0/transfers/downloads"
306+
307+
body, err := c.HttpClient.MakeRequest("GET", c.Cfg.URL+reqParams, nil, nil)
308+
if err != nil {
309+
return nil, err
310+
}
311+
312+
var status DownloadStatus
313+
if err := util.ParseResp(body, &status); err != nil {
314+
return nil, err
315+
}
316+
return status, nil
317+
}
318+
304319
func (c Lidarr) MonitorDownloads(tracks []*models.Track) error {
305320
monitorCfg := MonitorConfig{
306321
CheckInterval: 1 * time.Minute,
@@ -322,21 +337,6 @@ func (c Lidarr) MonitorDownloads(tracks []*models.Track) error {
322337
return nil
323338
}
324339

325-
func (c Lidarr) getDownloadStatus() (DownloadStatus, error) {
326-
reqParams := "/api/v0/transfers/downloads"
327-
328-
body, err := c.HttpClient.MakeRequest("GET", c.Cfg.URL+reqParams, nil, nil)
329-
if err != nil {
330-
return nil, err
331-
}
332-
333-
var status DownloadStatus
334-
if err := util.ParseResp(body, &status); err != nil {
335-
return nil, err
336-
}
337-
return status, nil
338-
}
339-
340340
func (c Lidarr) cleanupTrack(track *models.Track, fileID string) {
341341
if err := c.deleteSearch(track.ID); err != nil {
342342
debug.Debug(fmt.Sprintf("[slskd] failed to delete search request: %v", err))

0 commit comments

Comments
 (0)