Update Metadata Bugfix (#3757)

This commit is contained in:
yoshnopa 2023-05-25 01:29:05 +02:00 committed by GitHub
parent 94dda49352
commit ed7640b7b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -69,10 +69,16 @@ func (d *Decorator) IsMissingMetadata(ctx context.Context, fs file.FS, f file.Fi
unsetNumber = -1
)
imf, ok := f.(*file.ImageFile)
if !ok {
imf, isImage := f.(*file.ImageFile)
vf, isVideo := f.(*file.VideoFile)
switch {
case isImage:
return imf.Format == unsetString || imf.Width == unsetNumber || imf.Height == unsetNumber
case isVideo:
videoFileDecorator := video.Decorator{FFProbe: d.FFProbe}
return videoFileDecorator.IsMissingMetadata(ctx, fs, vf)
default:
return true
}
return imf.Format == unsetString || imf.Width == unsetNumber || imf.Height == unsetNumber
}