Videos: Don't transcode the same file twice #703

This commit is contained in:
Michael Mayer 2020-12-14 09:23:07 +01:00
parent 1321192eff
commit e3190a9f3f

View file

@ -269,6 +269,10 @@ func (c *Convert) ToJpeg(image *MediaFile) (*MediaFile, error) {
defer c.cmdMutex.Unlock()
}
if fs.FileExists(jpegName) {
return NewMediaFile(jpegName)
}
// Fetch command output.
var out bytes.Buffer
var stderr bytes.Buffer
@ -350,6 +354,10 @@ func (c *Convert) ToAvc(video *MediaFile) (*MediaFile, error) {
defer c.cmdMutex.Unlock()
}
if fs.FileExists(avcName) {
return NewMediaFile(avcName)
}
// Fetch command output.
var out bytes.Buffer
var stderr bytes.Buffer