diff --git a/client/mpd/djrandom.go b/client/mpd/djrandom.go index 1fb6e49cbab7d47f4c4d4aa9f7954144e40d2aa5..95b483e5534ea894bb38408a9fed8dcc018b1604 100644 --- a/client/mpd/djrandom.go +++ b/client/mpd/djrandom.go @@ -60,6 +60,13 @@ func (s *DJRandomSong) SampleRate() float64 { return 44100 } +func (s *DJRandomSong) Duration() int { + if s.audiofile != nil { + return int(s.audiofile.Duration) + } + return 0 +} + func (s *DJRandomSong) URL() string { return fmt.Sprintf("djrandom://%s", s.Id.String()) }