mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Associate funscript files on scan (#2978)
This commit is contained in:
@@ -55,3 +55,25 @@ func (d *Decorator) Decorate(ctx context.Context, fs file.FS, f file.File) (file
|
||||
Interactive: interactive,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *Decorator) IsMissingMetadata(ctx context.Context, fs file.FS, f file.File) bool {
|
||||
const (
|
||||
unsetString = "unset"
|
||||
unsetNumber = -1
|
||||
)
|
||||
|
||||
vf, ok := f.(*file.VideoFile)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
|
||||
interactive := false
|
||||
if _, err := fs.Lstat(GetFunscriptPath(vf.Base().Path)); err == nil {
|
||||
interactive = true
|
||||
}
|
||||
|
||||
return vf.VideoCodec == unsetString || vf.AudioCodec == unsetString ||
|
||||
vf.Format == unsetString || vf.Width == unsetNumber ||
|
||||
vf.Height == unsetNumber || vf.FrameRate == unsetNumber ||
|
||||
vf.BitRate == unsetNumber || interactive != vf.Interactive
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user