Compare commits

...

2 Commits

Author SHA1 Message Date
Hazel Noack
3396109e00 added file extention to cache 2025-07-15 13:58:44 +02:00
Hazel Noack
fb6afc2ffe minor improvement 2025-07-15 13:10:30 +02:00
3 changed files with 7 additions and 7 deletions

View File

@ -118,7 +118,7 @@ func (rc *Config) ScanForConfigFile(profile string) error {
return err
}
return errors.New("No config file found")
return errors.New("no config file found")
}
func (rc *Config) LoadConfigFile(file string) error {
@ -138,10 +138,12 @@ func (rc *Config) LoadConfigFile(file string) error {
}
func (c *Config) Init() error {
for i, w := range c.Template.Websites {
fmt.Print("downloading website icons")
for i, _ := range c.Template.Websites {
fmt.Print(".")
c.Template.Websites[i].Cache()
fmt.Println(w.ImageUrl)
}
fmt.Print("\n")
return nil
}

View File

@ -3,7 +3,6 @@ package rendering
import (
"crypto/sha1"
"encoding/hex"
"fmt"
"io"
"net/http"
"net/url"
@ -49,8 +48,7 @@ func (w *Website) Cache() error {
return err
}
filename := hashUrl(w.ImageUrl)
fmt.Println(w.ImageUrl + " => " + filename)
filename := hashUrl(w.ImageUrl) + filepath.Ext(w.ImageUrl)
targetPath := filepath.Join(cacheDir, filename)
resp, err := http.Get(w.ImageUrl)
if err != nil {

View File

@ -1 +1 @@
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1