diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-07-21 15:56:34 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-07-21 15:56:34 +0200 |
| commit | d1558cf352f24c311b8505661143973d11d9edba (patch) | |
| tree | ea5d01b8644f51603ef04e7e6187baca908cb7ad /playlist.go | |
| parent | 9cb08df11d7446357c5d480d08d256b906d4988e (diff) | |
| download | WRMS-d1558cf352f24c311b8505661143973d11d9edba.tar.gz WRMS-d1558cf352f24c311b8505661143973d11d9edba.zip | |
backend: support an incremental time bonus
Diffstat (limited to 'playlist.go')
| -rw-r--r-- | playlist.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/playlist.go b/playlist.go index 1fbd344..aeb1297 100644 --- a/playlist.go +++ b/playlist.go @@ -74,3 +74,11 @@ func (pl *Playlist) OrderedList() []*Song { return songs } + +func (pl *Playlist) applyTimeBonus(timeBonus float64) { + for _, s := range *pl { + s.Weight += timeBonus + } + heap.Init(pl) + llog.DDebug("applying time bonus to the playlist") +} |
