aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
diff options
context:
space:
mode:
Diffstat (limited to 'wrms.go')
-rw-r--r--wrms.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/wrms.go b/wrms.go
index a345767..1f1332e 100644
--- a/wrms.go
+++ b/wrms.go
@@ -18,7 +18,7 @@ type Song struct {
Artist string `json:"artist"`
Source string `json:"source"`
Uri string `json:"uri"`
- Weight int `json:"weight"`
+ Weight float64 `json:"weight"`
Album string `json:"album"`
Year int `json:"year"`
index int `json:"-"` // used by heap.Interface
@@ -296,6 +296,11 @@ func (wrms *Wrms) AddSong(song Song) {
s := &wrms.Songs[len(wrms.Songs)-1]
wrms.queue.Add(s)
+ if wrms.Config.timeBonus != 0 {
+ llog.Info("Apply time bonus %v", wrms.Config.timeBonus)
+ wrms.queue.applyTimeBonus(wrms.Config.timeBonus)
+ }
+
wrms.rwlock.Unlock()
llog.Info("Added song %s (ptr=%p) to Songs", s.Uri, s)