diff options
Diffstat (limited to 'server/cmd')
| -rw-r--r-- | server/cmd/second-probe/main.go | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/server/cmd/second-probe/main.go b/server/cmd/second-probe/main.go deleted file mode 100644 index 1d2a840..0000000 --- a/server/cmd/second-probe/main.go +++ /dev/null @@ -1,56 +0,0 @@ -// Command second-probe subtracts a recognised second fetch from the mirrored copy. Throwaway. -package main - -import ( - "flag" - "fmt" - "os" - "path/filepath" - - "github.com/terst/listen/server/internal/transcribe" - "github.com/terst/listen/server/internal/transcript" -) - -func main() { - episode := flag.String("episode", "", "episode id") - secondFile := flag.String("second", "", "whisper -oj output for the second fetch") - servedMs := flag.Int64("served", 0, "") - declaredMs := flag.Int64("declared", 0, "") - show := flag.Bool("show", false, "") - flag.Parse() - - store := transcript.Store{Dir: "/site/listen.terst.org/data/transcripts"} - mirrored, err := store.Get(*episode) - if err != nil { - panic(err) - } - raw, err := os.ReadFile(*secondFile) - if err != nil { - panic(err) - } - second, err := transcribe.ParseOutput(raw) - if err != nil { - panic(err) - } - fmt.Printf("mirrored %d cues, second %d cues\n", len(mirrored.Cues), len(second.Cues)) - - found := transcript.Inserted(second.Cues, mirrored.Cues) - var total int64 - for _, c := range found { - total += c.EndMs - c.StartMs - fmt.Printf(" %s-%s (%s)\n", clock(c.StartMs), clock(c.EndMs), clock(c.EndMs-c.StartMs)) - if *show { - for _, cue := range mirrored.Cues { - if cue.StartMs >= c.StartMs && cue.EndMs <= c.EndMs { - fmt.Printf(" %.88s\n", cue.Text) - } - } - } - } - gap := *servedMs - *declaredMs - fmt.Printf("\n%d pods, %s found of the %s inserted (%d%%)\n", - len(found), clock(total), clock(gap), total*100/gap) - _ = filepath.Join -} - -func clock(ms int64) string { return fmt.Sprintf("%d:%02d", ms/1000/60, ms/1000%60) } |
