stop overwriting footage_dir after processing
This commit is contained in:
parent
a3b9ec2cb6
commit
b4a244a456
1 changed files with 5 additions and 6 deletions
11
main.go
11
main.go
|
|
@ -189,14 +189,13 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// default footage directory
|
// default footage directory
|
||||||
if len(metadata.FootageDir) == 0 {
|
footageDir := directory
|
||||||
metadata.FootageDir = directory
|
if len(metadata.FootageDir) >= 0 && !strings.HasPrefix(metadata.FootageDir, "/") {
|
||||||
} else if !strings.HasPrefix(metadata.FootageDir, "/") {
|
footageDir = path.Join(directory, metadata.FootageDir)
|
||||||
metadata.FootageDir = path.Join(directory, metadata.FootageDir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// scan for VOD segments
|
// scan for VOD segments
|
||||||
vodFiles, err := scanner.ScanSegments(metadata.FootageDir, SEGMENT_EXTENSION)
|
vodFiles, err := scanner.ScanSegments(footageDir, SEGMENT_EXTENSION)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to fetch VOD filenames: %v", err)
|
log.Fatalf("Failed to fetch VOD filenames: %v", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
@ -270,7 +269,7 @@ func main() {
|
||||||
var totalLength float64 = 0
|
var totalLength float64 = 0
|
||||||
|
|
||||||
for _, filename := range vodFiles {
|
for _, filename := range vodFiles {
|
||||||
probe, err := scanner.ProbeSegment(path.Join(metadata.FootageDir, filename))
|
probe, err := scanner.ProbeSegment(path.Join(footageDir, filename))
|
||||||
if err != nil { continue }
|
if err != nil { continue }
|
||||||
totalLength += probe.Format.Duration
|
totalLength += probe.Format.Duration
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue