allow thumbnail.png to not exist

This commit is contained in:
ari melody 2026-06-23 19:07:51 +01:00
parent 2fcbc31f77
commit 234caa159e
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
3 changed files with 30 additions and 22 deletions

10
main.go
View file

@ -217,14 +217,16 @@ func main() {
}
// scan for thumbnail
var thumbnail *yt.Thumbnail
thumbnailPath, thumbnailSizeBytes, err := scanner.ScanThumbnail(directory)
if err != nil {
log.Fatalf("Failed to fetch thumbnail: %v", err)
os.Exit(1)
}
thumbnail := &yt.Thumbnail{
Filepath: thumbnailPath,
SizeBytes: thumbnailSizeBytes,
} else {
thumbnail = &yt.Thumbnail{
Filepath: thumbnailPath,
SizeBytes: thumbnailSizeBytes,
}
}
// build video template for upload