added file extention to cache
This commit is contained in:
@@ -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,9 +138,12 @@ func (rc *Config) LoadConfigFile(file string) error {
|
||||
}
|
||||
|
||||
func (c *Config) Init() error {
|
||||
fmt.Print("downloading website icons")
|
||||
for i, _ := range c.Template.Websites {
|
||||
fmt.Print(".")
|
||||
c.Template.Websites[i].Cache()
|
||||
}
|
||||
fmt.Print("\n")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user