make somewhat anonymous, improve evaluation
All checks were successful
release-tag / release-image (push) Successful in 6m27s
All checks were successful
release-tag / release-image (push) Successful in 6m27s
This commit is contained in:
@@ -8,7 +8,7 @@ from sqlalchemy.orm import Session
|
||||
|
||||
from app.database import get_db, engine, Base
|
||||
from app.security import get_current_user
|
||||
from app.crud import create_song, get_setting, set_setting
|
||||
from app.crud import create_song, get_setting, set_setting, get_all_songs_and_votes
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/admin",
|
||||
@@ -79,11 +79,12 @@ async def create_upload_file(include_non_singable: bool = False, db: Session = D
|
||||
category_names = list(song_list.iloc[0][8:17])
|
||||
|
||||
for i, row in song_list[1:].iterrows():
|
||||
if (row[17] == "nein") and not include_non_singable:
|
||||
continue
|
||||
|
||||
row = np.array(row)
|
||||
|
||||
if (row[17] == "nein") and not include_non_singable:
|
||||
continue
|
||||
|
||||
if not row[2]: # no title
|
||||
continue
|
||||
|
||||
@@ -126,3 +127,8 @@ async def toggle_veto_mode(db: Session = Depends(get_db)) -> bool:
|
||||
else:
|
||||
set_setting(db, "veto_mode", True)
|
||||
return True
|
||||
|
||||
|
||||
@router.get("/results")
|
||||
async def get_evaluation(db = Depends(get_db)) -> list:
|
||||
return get_all_songs_and_votes(db)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from typing import Annotated
|
||||
from fastapi import APIRouter, Depends, Request
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
import app.models as models
|
||||
from app.database import get_db
|
||||
from app.schemas import Song
|
||||
from app.crud import get_songs_and_vote_for_session, create_or_update_vote, get_all_songs_and_votes, create_or_update_comment
|
||||
from app.crud import get_songs_and_vote_for_session, create_or_update_vote, create_or_update_comment
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/songs",
|
||||
@@ -28,6 +27,3 @@ async def comment(song_id: str, session_id: str, comment: str, db: Annotated[Ses
|
||||
create_or_update_comment(db, song_id, session_id, comment)
|
||||
#create_or_update_vote(db, song_id, session_id, vote)
|
||||
|
||||
@router.get("/evaluation")
|
||||
async def get_evaluation(db: Annotated[Session, Depends(get_db)] = None) -> dict[int, dict[int, int]]:
|
||||
return get_all_songs_and_votes(db)
|
||||
|
||||
Reference in New Issue
Block a user