Skip to content

Commit db4f8ce

Browse files
author
AI-Spawn
committed
removed carriage return error when parsing timestamps on windows
1 parent 4ab0463 commit db4f8ce

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

align.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ func parseTimestamps(timestampsPath string) []Timestamp {
121121
var timestamps []Timestamp
122122
for _, l := range lines {
123123
parts := strings.Split(l, " ")
124+
parts[len(parts)-1] = strings.TrimSuffix(parts[len(parts)-1], "\r")
124125
var newStamp Timestamp
125126
time, err := strconv.Atoi(parts[0])
126127
if err != nil {
127128
fmt.Println("Error parsing int in Timestamps file:", parts[0])
128129
log.Fatal(err)
129130
}
131+
fmt.Println(len(parts[0]), len(parts[1]))
130132
newStamp.Time = uint32(time)
131133
newStamp.Name = parts[1]
132134
if len(parts) > 2 {

main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ func main() {
2929
}
3030

3131
logM(3, "Args:", args)
32-
32+
logM(1, "Parsing Timestamps...")
33+
timestamps := parseTimestamps(args.Timestamps)
34+
logM(2, "Timestamps:", timestamps)
3335
var text string
3436
if !args.SkipTranscriber {
3537
logM(1, "Transcribing Audio...")
@@ -51,9 +53,6 @@ func main() {
5153
}
5254
logM(3, gentleResponse)
5355

54-
logM(1, "Parsing Timestamps...")
55-
timestamps := parseTimestamps(args.Timestamps)
56-
logM(2, "Timestamps:", timestamps)
5756
genImageSequence(
5857
VideoRequest{
5958
gentleResponse,

videoGenerator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type Pose struct {
8787
func getPose(poseName string, character *jsonq.JsonQuery, characterDir string) Pose {
8888
p, e := character.Object("poses", poseName)
8989
if e != nil {
90-
fmt.Println("Error getting pose ", poseName)
90+
fmt.Println("Error getting pose:", poseName)
9191
log.Fatal(e)
9292
}
9393
var pose Pose

0 commit comments

Comments
 (0)