29 lines
677 B
Go
29 lines
677 B
Go
package main
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"git.velvettear.de/velvettear/gosplash/internal/config"
|
|
"git.velvettear.de/velvettear/gosplash/internal/unsplash"
|
|
"git.velvettear.de/velvettear/loggo"
|
|
)
|
|
|
|
// main method
|
|
func main() {
|
|
// TODO: IMPLEMENT LOG LEVEL SHIT
|
|
loggo.SetLogLevel(loggo.DebugLevel)
|
|
config.Initialize()
|
|
images := unsplash.GetImages()
|
|
imageCount := len(images)
|
|
for index, image := range images {
|
|
warning, error := image.Download()
|
|
if error != nil {
|
|
loggo.Error("encountered an error downloading image "+strconv.Itoa(index+1)+"/"+strconv.Itoa(imageCount), error.Error())
|
|
continue
|
|
}
|
|
if len(warning) == 0 {
|
|
continue
|
|
}
|
|
loggo.Warning(warning)
|
|
}
|
|
}
|