Fix a bug

This commit is contained in:
Lost-MSth
2020-12-22 13:07:49 +08:00
parent 26216bf84a
commit 68c757f9d7

View File

@@ -297,6 +297,7 @@ def update_recent30(c, user_id, song_id, rating, is_protected):
b_pre = [x for x in b] b_pre = [x for x in b]
s_pre = 0 s_pre = 0
for x in a_pre: for x in a_pre:
if x is not None:
s_pre += x s_pre += x
for i in range(r30_id, 0, -1): for i in range(r30_id, 0, -1):
@@ -308,6 +309,7 @@ def update_recent30(c, user_id, song_id, rating, is_protected):
if is_protected: if is_protected:
s = 0 s = 0
for x in a: for x in a:
if x is not None:
s += x s += x
if s < s_pre: if s < s_pre:
a = [x for x in a_pre] a = [x for x in a_pre]