Associate funscript files on scan (#2978)

This commit is contained in:
WithoutPants
2022-10-06 11:17:01 +11:00
committed by GitHub
parent 55001ddcf1
commit b160c3bb97
4 changed files with 52 additions and 20 deletions

View File

@@ -37,3 +37,17 @@ func (d *Decorator) Decorate(ctx context.Context, fs file.FS, f file.File) (file
Height: c.Height,
}, nil
}
func (d *Decorator) IsMissingMetadata(ctx context.Context, fs file.FS, f file.File) bool {
const (
unsetString = "unset"
unsetNumber = -1
)
imf, ok := f.(*file.ImageFile)
if !ok {
return true
}
return imf.Format == unsetString || imf.Width == unsetNumber || imf.Height == unsetNumber
}