Skip to content

Commit 448f165

Browse files
committed
Remove timeout from main.go
Fix rebase more
1 parent 3193bde commit 448f165

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/config/config.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ type Config struct {
1818
Persist bool `env:"PERSIST" env-default:"true"`
1919
System string `env:"EXPLO_SYSTEM"`
2020
Debug bool `env:"DEBUG" env-default:"false"`
21-
Timeout int `env:"TIMEOUT" env-default:"10"`
2221
}
2322

2423
type ClientConfig struct {
2524
ClientID string `env:"CLIENT_ID" env-default:"explo"`
2625
LibraryName string `env:"LIBRARY_NAME" env-default:"Explo"`
2726
URL string `env:"SYSTEM_URL"`
2827
DownloadDir string `env:"DOWNLOAD_DIR"`
28+
SlskdDir string `env:"SLSKD_DIR"`
2929
PlaylistDir string `env:"PLAYLIST_DIR"`
3030
PlaylistName string
3131
PlaylistID string
@@ -99,11 +99,10 @@ type Slskd struct {
9999
}
100100

101101
type Youtube struct {
102-
APIKey string `env:"YOUTUBE_API_KEY"`
103-
Separator string `env:"FILENAME_SEPARATOR" env-default:" "`
104-
FfmpegPath string `env:"FFMPEG_PATH"`
105-
YtdlpPath string `env:"YTDLP_PATH"`
106-
FilterList []string `env:"FILTER_LIST" env-default:"live,remix,instrumental,extended"`
102+
APIKey string `env:"YOUTUBE_API_KEY"`
103+
FfmpegPath string `env:"FFMPEG_PATH"`
104+
YtdlpPath string `env:"YTDLP_PATH"`
105+
Filters Filters
107106
}
108107

109108
func ReadEnv() Config {

src/main/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"explo/src/debug"
55
"log"
6-
"time"
76

87
"explo/src/client"
98
"explo/src/config"
@@ -18,9 +17,9 @@ type Song struct {
1817
Album string
1918
}
2019

21-
func initHttpClient(cfg *config.Config) *util.HttpClient {
20+
func initHttpClient() *util.HttpClient {
2221
return util.NewHttp(util.HttpClientConfig{
23-
Timeout: time.Duration(cfg.Timeout) * time.Second,
22+
Timeout: 10,
2423
})
2524
}
2625

@@ -33,7 +32,7 @@ func main() {
3332

3433
cfg := config.ReadEnv()
3534
setup(&cfg)
36-
httpClient := initHttpClient(&cfg)
35+
httpClient := initHttpClient()
3736
client, err := client.NewClient(&cfg, httpClient)
3837
if err != nil {
3938
log.Fatal(err)

0 commit comments

Comments
 (0)