Make a SongList.Current() return a copy of a current song.
This commit is contained in:
parent
04e09dd800
commit
e63f0aead3
@ -76,7 +76,12 @@ func (sl *SongList) Current() *Song {
|
|||||||
if sl.current.StartAt.Year() == 1 {
|
if sl.current.StartAt.Year() == 1 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return &sl.current
|
return &Song{
|
||||||
|
Artist: sl.current.Artist,
|
||||||
|
Title: sl.current.Title,
|
||||||
|
Duration: sl.current.Duration,
|
||||||
|
MaxListeners: sl.current.MaxListeners,
|
||||||
|
StartAt: sl.current.StartAt}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateCurrentMaxListeners checks and updates a maximal number of listeners
|
// UpdateCurrentMaxListeners checks and updates a maximal number of listeners
|
||||||
|
Loading…
Reference in New Issue
Block a user