From d491f136b40b9bff6ec0ff1e0a4f26cf855a9ffc Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 1 Jul 2023 18:54:52 +0200 Subject: add simple wrms test --- wrms.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'wrms.go') 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 -- cgit v1.2.3