do not download broken files

This commit is contained in:
Aaron Fischer 2024-03-11 22:19:32 +01:00
parent 2b7c578a34
commit 73e6410fd2

View file

@ -46,6 +46,10 @@ func (i Item) downloadCover() error {
}
}(resp.Body)
if resp.StatusCode != 200 {
return fmt.Errorf("HTTP status code is %d", resp.StatusCode)
}
out, err := os.Create(i.targetFilename())
if err != nil {
return err