Skip to content

Commit

Permalink
Double thumbnail quality
Browse files Browse the repository at this point in the history
Fix tag query
  • Loading branch information
JonasKs committed Apr 12, 2022
1 parent c175454 commit 2efd398
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/api/api_v2/endpoints/video/list_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Optional

from fastapi import APIRouter, Depends, Query
from sqlalchemy import and_, desc, func
from sqlalchemy import and_, desc, func, or_
from sqlalchemy.orm import selectinload
from sqlmodel import select
from sqlmodel.ext.asyncio.session import AsyncSession
Expand Down Expand Up @@ -50,8 +50,8 @@ async def get_all_files(
else:
video_statement = video_statement.where(Video.hidden == False) # noqa

for t in tag:
video_statement = video_statement.where(Video.tags.any(name=t)) # type: ignore
if tag:
video_statement = video_statement.where(or_(Video.tags.any(name=t) for t in tag)) # type: ignore

# Total count query based on query params, without pagination
count_statement = select(func.count('*')).select_from(video_statement) # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion app/api/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def generate_video_thumbnail(path: str, name: str) -> StreamSpec:
"""
Cuts first frame and generates a new file
"""
return ffmpeg.input(path).filter('scale', 420, -1).output(name, vframes=1)
return ffmpeg.input(path).filter('scale', 840, -1).output(name, vframes=1)


async def await_ffmpeg(function: Callable) -> None:
Expand Down

0 comments on commit 2efd398

Please sign in to comment.