fix: Lint fixes of last errors in app
This commit is contained in:
@@ -45,7 +45,7 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
logger.info("Extraction processor stopped")
|
||||
|
||||
|
||||
def create_app():
|
||||
def create_app() -> FastAPI:
|
||||
"""Create and configure the FastAPI application."""
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class PlaylistService:
|
||||
# Fallback to main playlist if no current playlist is set
|
||||
return await self.get_main_playlist()
|
||||
|
||||
async def create_playlist(
|
||||
async def create_playlist( # noqa: PLR0913
|
||||
self,
|
||||
user_id: int,
|
||||
name: str,
|
||||
@@ -101,7 +101,7 @@ class PlaylistService:
|
||||
logger.info("Created playlist '%s' for user %s", name, user_id)
|
||||
return playlist
|
||||
|
||||
async def update_playlist(
|
||||
async def update_playlist( # noqa: PLR0913
|
||||
self,
|
||||
playlist_id: int,
|
||||
user_id: int,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Sound normalizer service for normalizing audio files using ffmpeg loudnorm."""
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
@@ -138,7 +139,9 @@ class SoundNormalizerService:
|
||||
stream = ffmpeg.output(stream, str(output_path), **output_args)
|
||||
stream = ffmpeg.overwrite_output(stream)
|
||||
|
||||
ffmpeg.run(stream, quiet=True, overwrite_output=True)
|
||||
await asyncio.to_thread(
|
||||
ffmpeg.run, stream, quiet=True, overwrite_output=True,
|
||||
)
|
||||
logger.info("One-pass normalization completed: %s", output_path)
|
||||
|
||||
except Exception:
|
||||
@@ -176,7 +179,9 @@ class SoundNormalizerService:
|
||||
|
||||
# Run first pass and capture output
|
||||
try:
|
||||
result = ffmpeg.run(stream, capture_stderr=True, quiet=True)
|
||||
result = await asyncio.to_thread(
|
||||
ffmpeg.run, stream, capture_stderr=True, quiet=True,
|
||||
)
|
||||
analysis_output = result[1].decode("utf-8")
|
||||
except ffmpeg.Error as e:
|
||||
logger.exception(
|
||||
@@ -256,7 +261,9 @@ class SoundNormalizerService:
|
||||
stream = ffmpeg.overwrite_output(stream)
|
||||
|
||||
try:
|
||||
ffmpeg.run(stream, quiet=True, overwrite_output=True)
|
||||
await asyncio.to_thread(
|
||||
ffmpeg.run, stream, quiet=True, overwrite_output=True,
|
||||
)
|
||||
logger.info("Two-pass normalization completed: %s", output_path)
|
||||
except ffmpeg.Error as e:
|
||||
logger.exception(
|
||||
|
||||
Reference in New Issue
Block a user