Merge branch 'feat/verbose'

This commit is contained in:
lb-a
2026-05-07 23:56:42 +02:00
7 changed files with 163 additions and 8 deletions

View File

@@ -26,6 +26,7 @@ import (
soundcloudprovider "streamrip-go/internal/provider/soundcloud"
tidalprovider "streamrip-go/internal/provider/tidal"
"streamrip-go/internal/store"
"streamrip-go/internal/verbose"
)
type Main struct {
@@ -114,7 +115,7 @@ func New(cfg *config.Config) (*Main, error) {
"soundcloud": soundcloudprovider.New(cfg),
}
return &Main{
m := &Main{
Config: cfg,
Providers: providers,
Store: db,
@@ -122,7 +123,9 @@ func New(cfg *config.Config) (*Main, error) {
Tagger: tag.New(),
Pending: []media.Pending{},
Media: []media.Media{},
}, nil
}
verbose.SetSink(func(msg string) { m.DL.Logf("%s", msg) })
return m, nil
}
// downloaderMaxConnsPerHost picks the per-host idle connection cap for the
@@ -137,6 +140,7 @@ func downloaderMaxConnsPerHost(maxConnections int) int {
}
func (m *Main) Close() error {
verbose.SetSink(nil)
m.DL.Close()
artwork.CleanupTempDirs()
for _, p := range m.Providers {