mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
harden ffmpeg pipeline failure handling and stream mapping
This commit is contained in:
@@ -52,13 +52,13 @@ func Convert(path string, cfg config.ConversionConfig) (string, error) {
|
||||
return path, fmt.Errorf("conversion failed: %w: %s", err, string(output))
|
||||
}
|
||||
|
||||
if path != finalPath {
|
||||
_ = os.Remove(path)
|
||||
}
|
||||
if err = os.Rename(tmpPath, finalPath); err != nil {
|
||||
_ = os.Remove(tmpPath)
|
||||
return path, err
|
||||
}
|
||||
if path != finalPath {
|
||||
_ = os.Remove(path)
|
||||
}
|
||||
|
||||
return finalPath, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user