
from typing import List

from fastapi import APIRouter

from src.db.models.media import MediaArticle
from src.db.session import SessionDep
from src.schema.media.article import MediaArticleResponse, to_response

router = APIRouter()

@router.get("/articles", response_model=List[MediaArticleResponse])
def get_all_files(
    db: SessionDep, review: bool = False, download: bool = False
) -> List[MediaArticleResponse]:
    """
    Get all MediaVideos.
    """
    results: List[MediaArticleResponse] = []
    articles: List[MediaArticle]
    articles = db.query(MediaArticle).all()
    for article in articles:
        response = to_response(article)
        results.append(response)
    return results
