fix #4, use filepath.Join to create portable path's

This commit is contained in:
2023-12-18 09:21:26 +01:00
parent f932d7be83
commit 4d4577c9f8
2 changed files with 5 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ import (
"io"
"log/slog"
"net/http"
"path/filepath"
"strings"
"sync"
@@ -176,7 +177,7 @@ func ScrapeImages(dir string, ad *Ad) error {
failure := make(chan string)
for _, imguri := range ad.Images {
file := fmt.Sprintf("%s/%d.jpg", dir, img)
file := filepath.Join(dir, ad.Slug, fmt.Sprintf("%d.jpg", img))
go func() {
defer wg.Done()
err := Getimage(imguri, file)