Skip to content

Commit

Permalink
feat: Add youtube ID to watch output and output playhead to 2 decimal…
Browse files Browse the repository at this point in the history
… places.
  • Loading branch information
stephen304 authored and vishen committed Dec 13, 2020
1 parent 015812c commit 3f1f017
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ var watchCmd = &cobra.Command{
md := castMedia.Media.Metadata
metadata = fmt.Sprintf("title=%q, artist=%q", md.Title, md.Artist)
}
fmt.Printf(">> %s (%s), %s, time remaining=%.0fs/%.0fs, volume=%0.2f, muted=%t\n", castApplication.DisplayName, castMedia.PlayerState, metadata, castMedia.CurrentTime, castMedia.Media.Duration, castVolume.Level, castVolume.Muted)
switch castMedia.Media.ContentType {
case "x-youtube/video":
metadata = fmt.Sprintf("id=\"%s\", %s", castMedia.Media.ContentId, metadata)
}
fmt.Printf(">> %s (%s), %s, time remaining=%.2fs/%.2fs, volume=%0.2f, muted=%t\n", castApplication.DisplayName, castMedia.PlayerState, metadata, castMedia.CurrentTime, castMedia.Media.Duration, castVolume.Level, castVolume.Muted)
}
time.Sleep(time.Millisecond * time.Duration(interval * 1000))
}
Expand Down

0 comments on commit 3f1f017

Please sign in to comment.