more cleaning logics
This commit is contained in:
parent
de628f4911
commit
20245c109b
4 changed files with 28 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue