1
0

Make a SongList.Current() return a copy of a current song.

This commit is contained in:
Alexander Andreev 2023-10-08 23:52:10 +04:00
parent 04e09dd800
commit e63f0aead3
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -76,7 +76,12 @@ func (sl *SongList) Current() *Song {
if sl.current.StartAt.Year() == 1 {
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