Skip to content

Commit 056e380

Browse files
author
extreme4all
committed
refactor: update report migration logic and streamline report count retrieval
1 parent b3e5daf commit 056e380

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/api/v1/report.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ async def select_or_insert_migration(name: str):
217217
"""
218218
sql_insert = """
219219
INSERT report_migrated (reporting_id, migrated)
220-
SELECT id, 0 as migrated FROM Players pl where pl.name = :name
220+
SELECT id, 1 as migrated FROM Players pl where pl.name = :name
221221
"""
222222

223223
params = {"name": name}
@@ -278,12 +278,18 @@ async def get_report_count_v1(name: str):
278278
"""
279279
Get the calculated player report count
280280
"""
281-
return await report_count(name=name, manual_detect=0)
281+
# _count = report_count(name=name, manual_detect=0)
282+
# _count = await select_report_count_v1(name=name, manual_detect=0)
283+
_count = await select_report_count_v2(name=name, manual_detect=0)
284+
return _count
282285

283286

284287
@router.get("/report/manual/count", tags=["Report"])
285288
async def get_report_manual_count_v1(name: str):
286289
"""
287290
Get the calculated player report count
288291
"""
289-
return await report_count(name=name, manual_detect=1)
292+
# _count = report_count(name=name, manual_detect=1)
293+
# _count = await select_report_count_v1(name=name, manual_detect=1)
294+
_count = await select_report_count_v2(name=name, manual_detect=1)
295+
return _count

0 commit comments

Comments
 (0)