Implementing the previous commit

In main.go we are setting the default image path.
and whenever we don't find the image through lastfm we pointhepath to
default image in render.go
This commit is contained in:
aditya-K2 2021-11-26 22:02:20 +05:30
parent 3195223e82
commit 2a2e6336e4
2 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,7 @@ func main() {
} }
defer CONN.Close() defer CONN.Close()
cache.SetCacheDir(viper.GetString("CACHE_DIR")) cache.SetCacheDir(viper.GetString("CACHE_DIR"))
cache.SetDefaultPath(viper.GetString("DEFAULT_IMAGE_PATH"))
cache.LoadCache(viper.GetString("CACHE_FILE")) cache.LoadCache(viper.GetString("CACHE_FILE"))
r := newRenderer() r := newRenderer()
c, _ := CONN.CurrentSong() c, _ := CONN.CurrentSong()

View File

@ -86,6 +86,8 @@ func getImagePath(path string) string {
if err == nil { if err == nil {
NOTIFICATION_SERVER.Send("Image From LastFM") NOTIFICATION_SERVER.Send("Image From LastFM")
extractedImage = downloadedImage extractedImage = downloadedImage
} else {
cache.PointToDefault(a[0]["artist"], a[0]["album"])
} }
} }
} }