Remove obsolete endpoints (#89)
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Remove endpoints api/login/token and api/login/profile --------- Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #89
This commit was merged in pull request #89.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
|
||||
from typing import List
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from src.db.models.media import MediaVideo
|
||||
from src.db.session import SessionDep
|
||||
from src.schema.media.video import MediaVideoResponse, to_response
|
||||
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/videos", response_model=List[MediaVideoResponse])
|
||||
def get_all_files(
|
||||
db: SessionDep, review: bool = False, download: bool = False
|
||||
) -> List[MediaVideoResponse]:
|
||||
"""
|
||||
Get all MediaVideos.
|
||||
"""
|
||||
results: List[MediaVideoResponse] = []
|
||||
files: List[MediaVideo]
|
||||
if review:
|
||||
files = db.query(MediaVideo).filter(MediaVideo.review.is_(True)).all()
|
||||
elif download:
|
||||
files = db.query(MediaVideo).filter(MediaVideo.should_download.is_(True)).all()
|
||||
else:
|
||||
files = db.query(MediaVideo).all()
|
||||
for mediafile in files:
|
||||
response = to_response(mediafile)
|
||||
results.append(response)
|
||||
return results
|
||||
Reference in New Issue
Block a user