Fixes reverse rank calculation

This commit is contained in:
Mouse Reeve
2021-04-26 11:09:24 -07:00
parent 5b5da46ede
commit 32b3a02a17
2 changed files with 70 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class SuggestedUsers(RedisStore):
"""calculate mutuals count and shared books count from rank"""
return {
"mutuals": math.floor(rank),
"shared_books": int(1 / (-1 * (1 % rank - 1))) if rank else 0,
"shared_books": int(1 / (-1 * (rank % 1 - 1))) - 1,
}
def get_objects_for_store(self, store):