Skip to content

Commit

Permalink
Code no longer makes assumption about source filename format - #7
Browse files Browse the repository at this point in the history
  • Loading branch information
petergeneric committed Oct 10, 2020
1 parent a789509 commit 50bb163
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion remux.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ func RemuxCLI(files []string, extractAudio bool, extractVideo bool, forceRate in

// Strip the unixtime from the filename, we'll replace with the start timecode of the partition
baseFilename := strings.TrimSuffix(path.Base(ubvFile), path.Ext(ubvFile))
baseFilename = baseFilename[0:strings.LastIndex(baseFilename, "_")]

// If the filename contains underscores, assume it's a Unifi Protect Filename
// and drop the final component.
if strings.Contains(baseFilename, "_") {
baseFilename = baseFilename[0:strings.LastIndex(baseFilename, "_")]
}

basename := outputFolder + "/" + baseFilename + "_" + strings.ReplaceAll(getStartTimecode(partition).Format(time.RFC3339), ":", ".")

Expand Down

0 comments on commit 50bb163

Please sign in to comment.