From b28d08f95ee2448d9f18bdebdff904a213706036 Mon Sep 17 00:00:00 2001 From: serr Date: Sun, 18 May 2025 14:11:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=BE?= =?UTF-8?q?=D1=82=20=D0=BB=D0=B0=D1=81=D1=82=D1=84=D0=BC=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=84=D0=B8=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mvc/controllers/lastfm.go | 2 +- mvc/models/config.go | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/mvc/controllers/lastfm.go b/mvc/controllers/lastfm.go index ac0e84b..b700433 100644 --- a/mvc/controllers/lastfm.go +++ b/mvc/controllers/lastfm.go @@ -12,7 +12,7 @@ func LastfmHandler(app *models.App) http.HandlerFunc { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { var err error - resp, err := models.GetRecentTracks("s3rr", "bc5ce9ff9289ac925841cf483e211fc1") + resp, err := models.GetRecentTracks(app.Cfg.LastfmUsername, app.Cfg.LastfmToken) if err != nil { log.Println(err) } diff --git a/mvc/models/config.go b/mvc/models/config.go index 28215ba..2a425b2 100644 --- a/mvc/models/config.go +++ b/mvc/models/config.go @@ -10,16 +10,18 @@ const ( ) type Config struct { - PostsDir string - AssetsDir string - TemplatesDir string - TemplatesExt string - LocalIP string - LocalPort string - ServerIP string - ServerPort string - ServerDomain string - Port string + PostsDir string + AssetsDir string + TemplatesDir string + TemplatesExt string + LocalIP string + LocalPort string + ServerIP string + ServerPort string + ServerDomain string + Port string + LastfmUsername string + LastfmToken string } func loadConfig(configPath string) (*Config, error) {