Skip to content

Commit

Permalink
remove feedback vote (Bot-detector#33)
Browse files Browse the repository at this point in the history
Co-authored-by: extreme4all <>
  • Loading branch information
extreme4all authored Nov 15, 2023
1 parent c552fed commit 66b2583
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
28 changes: 12 additions & 16 deletions src/app/models/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,25 @@ async def get_report_score(self, player_names: tuple[str]):

async def get_feedback_score(self, player_names: list[str]):
# dbFeedback
feedback_voter: dbPlayer = aliased(dbPlayer, name="feedback_voter")
feedback_subject: dbPlayer = aliased(dbPlayer, name="feedback_subject")
fb_voter: dbPlayer = aliased(dbPlayer, name="feedback_voter")
fb_subject: dbPlayer = aliased(dbPlayer, name="feedback_subject")

query: Select = select(
[
func.count(func.distinct(feedback_subject.id)).label("count"),
feedback_subject.possible_ban,
feedback_subject.confirmed_ban,
feedback_subject.confirmed_player,
dbFeedback.vote,
func.count(func.distinct(fb_subject.id)).label("count"),
fb_subject.possible_ban,
fb_subject.confirmed_ban,
fb_subject.confirmed_player,
]
)
query = query.select_from(dbFeedback)
query = query.join(feedback_voter, dbFeedback.voter_id == feedback_voter.id)
query = query.join(
feedback_subject, dbFeedback.subject_id == feedback_subject.id
)
query = query.where(feedback_voter.name.in_(player_names))
query = query.join(fb_voter, dbFeedback.voter_id == fb_voter.id)
query = query.join(fb_subject, dbFeedback.subject_id == fb_subject.id)
query = query.where(fb_voter.name.in_(player_names))
query = query.group_by(
feedback_subject.possible_ban,
feedback_subject.confirmed_ban,
feedback_subject.confirmed_player,
dbFeedback.vote,
fb_subject.possible_ban,
fb_subject.confirmed_ban,
fb_subject.confirmed_player,
)

async with self.session:
Expand Down
1 change: 0 additions & 1 deletion src/app/views/response/feedback_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ class FeedbackScoreResponse(BaseModel):
possible_ban: bool
confirmed_ban: bool
confirmed_player: bool
vote: int

0 comments on commit 66b2583

Please sign in to comment.