mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-07 21:48:18 -08:00
chore: move useragent to cfg
This commit is contained in:
parent
7b18ebb294
commit
63517c0a03
5 changed files with 15 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/gabehf/koito/internal/cfg"
|
||||
"github.com/gabehf/koito/internal/logger"
|
||||
"github.com/gabehf/koito/internal/utils"
|
||||
"github.com/gabehf/koito/queue"
|
||||
|
|
@ -48,10 +49,10 @@ const (
|
|||
artistImageEndpoint = "/search/artist?q=%s"
|
||||
)
|
||||
|
||||
func NewDeezerClient(useragent string) *DeezerClient {
|
||||
func NewDeezerClient() *DeezerClient {
|
||||
ret := new(DeezerClient)
|
||||
ret.url = deezerBaseUrl
|
||||
ret.userAgent = useragent
|
||||
ret.userAgent = cfg.UserAgent()
|
||||
ret.requestQueue = queue.NewRequestQueue(1, 1)
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func Initialize(opts ImageSourceOpts) {
|
|||
}
|
||||
if opts.EnableDeezer {
|
||||
imgsrc.deezerEnabled = true
|
||||
imgsrc.deezerC = NewDeezerClient(opts.UserAgent)
|
||||
imgsrc.deezerC = NewDeezerClient()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue