aboutsummaryrefslogtreecommitdiff
path: root/wrms.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-07-01 18:54:52 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-07-01 18:54:52 +0200
commitd491f136b40b9bff6ec0ff1e0a4f26cf855a9ffc (patch)
treee7fa41adc1a7aeb940095c1151958e74b254034a /wrms.go
parenta95fc844baf1f96510d59ba77a05755cd24fb777 (diff)
downloadWRMS-d491f136b40b9bff6ec0ff1e0a4f26cf855a9ffc.tar.gz
WRMS-d491f136b40b9bff6ec0ff1e0a4f26cf855a9ffc.zip
add simple wrms test
Diffstat (limited to 'wrms.go')
-rw-r--r--wrms.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/wrms.go b/wrms.go
index 9d94325..9371d93 100644
--- a/wrms.go
+++ b/wrms.go
@@ -394,7 +394,7 @@ func (wrms *Wrms) AdjustSongWeight(connId uuid.UUID, songUri string, vote string
continue
}
- llog.Info("Adjusting song %s (ptr=%p)", s.Uri, s)
+ llog.Info("Adjusting song %v (ptr=%p)", s, s)
switch vote {
case "up":
if _, ok := s.Upvotes[connId]; ok {
@@ -405,6 +405,7 @@ func (wrms *Wrms) AdjustSongWeight(connId uuid.UUID, songUri string, vote string
if _, ok := s.Downvotes[connId]; ok {
delete(s.Downvotes, connId)
s.Weight += 2
+ llog.Debug("Flip downvote")
} else {
s.Weight += 1
}
@@ -419,6 +420,7 @@ 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
} else {
s.Weight -= 1