more cleaning logics

This commit is contained in:
stefanodvx 2025-04-15 21:32:56 +02:00
parent de628f4911
commit 20245c109b
4 changed files with 28 additions and 1 deletions

View file

@ -194,7 +194,15 @@ func DownloadMedias(
}
if firstError != nil {
return results, firstError
for _, result := range results {
if result.FilePath != "" {
os.Remove(result.FilePath)
}
if result.ThumbnailFilePath != "" {
os.Remove(result.ThumbnailFilePath)
}
}
return nil, firstError
}
if len(results) > 1 {