Merge pull request #58 from acaloiaro/fix-time-elapsed-when-paused
fix: elapsed time continues ticking whilst paused/not playing
This commit is contained in:
commit
f350a20f84
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
|
@ -163,6 +163,10 @@ func configureEventHandling() {
|
||||||
go func() {
|
go func() {
|
||||||
c := time.Tick(1 * time.Second)
|
c := time.Tick(1 * time.Second)
|
||||||
for range c {
|
for range c {
|
||||||
|
// don't show elapsed time updates when playback is paused/not playing
|
||||||
|
if !ctx.IsPlaying {
|
||||||
|
continue
|
||||||
|
}
|
||||||
elapsed := time.Since(ctx.View.NowPlaying.Track.StartTime)
|
elapsed := time.Since(ctx.View.NowPlaying.Track.StartTime)
|
||||||
|
|
||||||
// If the current time is past the end of the track, then a new track is playing and the now playing track needs
|
// If the current time is past the end of the track, then a new track is playing and the now playing track needs
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue