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

@@ -195,6 +195,7 @@ type Store interface {
// Decorator wraps the Decorate method to add additional functionality while scanning files.
type Decorator interface {
Decorate(ctx context.Context, fs FS, f File) (File, error)
IsMissingMetadata(ctx context.Context, fs FS, f File) bool
}
type FilteredDecorator struct {
@@ -209,3 +210,11 @@ func (d *FilteredDecorator) Decorate(ctx context.Context, fs FS, f File) (File,
}
return f, nil
}
func (d *FilteredDecorator) IsMissingMetadata(ctx context.Context, fs FS, f File) bool {
if d.Accept(ctx, f) {
return d.Decorator.IsMissingMetadata(ctx, fs, f)
}
return false
}