diff --git a/internal/radio/song.go b/internal/radio/song.go index bb47e64..ff51ccc 100644 --- a/internal/radio/song.go +++ b/internal/radio/song.go @@ -16,6 +16,17 @@ type Song struct { StartAt time.Time } +func (s *Song) SetFrom(os *Song) { + s.mutex.Lock() + s.Artist = os.Artist + s.Title = os.Title + s.Duration = os.Duration + s.Listeners = os.Listeners + s.MaxListeners = os.MaxListeners + s.StartAt = os.StartAt + s.mutex.Unlock() +} + func (s *Song) UpdateMaxListeners(listeners int64) { s.mutex.Lock() if listeners > s.MaxListeners {