You've already forked VptPassiveAdapter
如果结束时间读取错误,不报错,由后续逻辑处理
This commit is contained in:
@ -42,7 +42,15 @@ func (l *LocalAdapter) GetFileList(dirPath string, relDt time.Time) ([]dto.File,
|
||||
continue
|
||||
}
|
||||
if startTime.Equal(stopTime) {
|
||||
stopTime = stopTime.Add(time.Second * time.Duration(config.Config.Record.Duration))
|
||||
// 如果文件名没有时间戳,则认为该文件是未录制完成的
|
||||
// 尝试读取一下视频信息
|
||||
duration, err := util.GetVideoDuration(path.Join(l.StorageConfig.Path, dirPath, file.Name()))
|
||||
if err != nil {
|
||||
// 如果还是没有,就按照配置文件里的加起来
|
||||
stopTime = stopTime.Add(time.Second * time.Duration(config.Config.Record.Duration))
|
||||
} else {
|
||||
stopTime = stopTime.Add(time.Second * time.Duration(duration))
|
||||
}
|
||||
}
|
||||
fileList = append(fileList, dto.File{
|
||||
BasePath: l.StorageConfig.Path,
|
||||
|
Reference in New Issue
Block a user