aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
diff options
context:
space:
mode:
Diffstat (limited to 'wrms.go')
-rw-r--r--wrms.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/wrms.go b/wrms.go
index 6650ae3..f6784c8 100644
--- a/wrms.go
+++ b/wrms.go
@@ -440,10 +440,10 @@ func (wrms *Wrms) AdjustSongWeight(connId uuid.UUID, songUri string, vote string
if _, ok := s.Downvotes[connId]; ok {
delete(s.Downvotes, connId)
- s.Weight += 2
+ s.Weight += 2.0
llog.Debug("Flip downvote")
} else {
- s.Weight += 1
+ s.Weight += 1.0
}
s.Upvotes[connId] = struct{}{}
@@ -457,9 +457,9 @@ func (wrms *Wrms) AdjustSongWeight(connId uuid.UUID, songUri string, vote string
if _, ok := s.Upvotes[connId]; ok {
delete(s.Upvotes, connId)
llog.Debug("Flip upvote")
- s.Weight -= 2
+ s.Weight -= 2.0
} else {
- s.Weight -= 1
+ s.Weight -= 1.0
}
s.Downvotes[connId] = struct{}{}
@@ -467,11 +467,11 @@ func (wrms *Wrms) AdjustSongWeight(connId uuid.UUID, songUri string, vote string
case "unvote":
if _, ok := s.Downvotes[connId]; ok {
delete(s.Downvotes, connId)
- s.Weight += 1
+ s.Weight += 1.0
} else if _, ok := s.Upvotes[connId]; ok {
delete(s.Upvotes, connId)
- s.Weight -= 1
+ s.Weight -= 1.0
} else {
llog.Error("Double unvote of song %s by connections %s", songUri, connId)
return