Skip to content

Commit 8e54c5c

Browse files
committed
move variable to downloadCfg
1 parent be9bda9 commit 8e54c5c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sample.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ LIBRARY_NAME=
3333
# USE_SUBDIRECTORY=true
3434
# Keep original file permissions when moving files (set to false on Synology devices)
3535
# KEEP_PERMISSIONS=true
36+
# Rename migrated track in {artist}-{title} format
37+
# RENAME_TRACK=false
3638
# Comma-separated list (no spaces) of download services, in priority order (default: youtube)
3739
# DOWNLOAD_SERVICES=youtube
3840

@@ -60,8 +62,6 @@ YOUTUBE_API_KEY=
6062
# SLSKD_API_KEY=
6163
# Whether to move downloads under the DOWNLOAD_DIR or not (default: false)
6264
# MIGRATE_DOWNLOADS=false
63-
# Rename migrated track in {artist}-{title} format
64-
# RENAME_TRACK=false
6565
# Directory where slskd downloads tracks (default: /slskd/)
6666
# PS! This is only needed on the binary version, in docker it's set through volume mapping
6767
# SLSKD_DIR=/slskd/

src/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ type DownloadConfig struct {
7272
Slskd Slskd
7373
ExcludeLocal bool
7474
KeepPermissions bool `env:"KEEP_PERMISSIONS" env-default:"true"` // keep original file permissions when migrating download
75+
RenameTrack bool `env:"RENAME_TRACK" env-default:"false"` // Rename track in {title}-{artist} format
7576
UseSubDir bool `env:"USE_SUBDIRECTORY" env-default:"true"`
7677
Discovery string `env:"LISTENBRAINZ_DISCOVERY" env-default:"playlist"`
7778
Services []string `env:"DOWNLOAD_SERVICES" env-default:"youtube"`
@@ -105,7 +106,6 @@ type Slskd struct {
105106
DownloadAttempts int `env:"SLSKD_DL_ATTEMPTS" env-default:"3"` // Max number of files to attempt downloading per track
106107
SlskdDir string `env:"SLSKD_DIR" env-default:"/slskd/"`
107108
MigrateDL bool `env:"MIGRATE_DOWNLOADS" env-default:"false"` // Move downloads from SlskdDir to DownloadDir
108-
RenameTrack bool `env:"RENAME_TRACK" env-default:"false"` // Rename track in {title}-{artist} format
109109
Timeout int `env:"SLSKD_TIMEOUT" env-default:"20"`
110110
Filters Filters
111111
MonitorConfig SlskdMon

src/downloader/downloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (c *DownloadClient) MoveDownload(srcDir, destDir, trackPath string, track *
178178
trackDir := filepath.Join(srcDir, trackPath)
179179
srcFile := filepath.Join(trackDir, track.File)
180180

181-
if c.Cfg.Slskd.RenameTrack { // Rename file to {title}-{artist} format
181+
if c.Cfg.RenameTrack { // Rename file to {title}-{artist} format
182182
track.File = getFilename(track.CleanTitle, track.MainArtist) + filepath.Ext(track.File)
183183
}
184184

0 commit comments

Comments
 (0)