McCloudS / subgen

Autogenerate subtitles using OpenAI Whisper Model via Jellyfin, Plex, Emby, Tautulli, or Bazarr
MIT License
453 stars 45 forks source link

Getting error due to renamed gen_subtitles call #61

Closed sjafferali closed 4 months ago

sjafferali commented 4 months ago

Getting the below error after setting this up for the first time. Seems like this function may have been accidentally reamed in the latest update: https://github.com/McCloudS/subgen/commit/f2a874b65d0196bfedaeb382cbf7e652d6addc7d

2024-03-20T01:53:11.356070262Z INFO:     172.25.10.1:60572 - "POST /jellyfin HTTP/1.1" 500 Internal Server Error
2024-03-20T01:53:11.360051873Z ERROR:    Exception in ASGI application
2024-03-20T01:53:11.360069320Z Traceback (most recent call last):
2024-03-20T01:53:11.360071443Z   File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
2024-03-20T01:53:11.360073498Z     result = await app(  # type: ignore[func-returns-value]
2024-03-20T01:53:11.360083352Z   File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
2024-03-20T01:53:11.360085258Z     return await self.app(scope, receive, send)
2024-03-20T01:53:11.360087067Z   File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in __call__
2024-03-20T01:53:11.360088799Z     await super().__call__(scope, receive, send)
2024-03-20T01:53:11.360090450Z   File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, in __call__
2024-03-20T01:53:11.360092174Z     await self.middleware_stack(scope, receive, send)
2024-03-20T01:53:11.360094362Z   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 186, in __call__
2024-03-20T01:53:11.360096155Z     raise exc
2024-03-20T01:53:11.360097720Z   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 164, in __call__
2024-03-20T01:53:11.360099590Z     await self.app(scope, receive, _send)
2024-03-20T01:53:11.360101244Z   File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
2024-03-20T01:53:11.360102909Z     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-03-20T01:53:11.360104732Z   File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-03-20T01:53:11.360106470Z     raise exc
2024-03-20T01:53:11.360108017Z   File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-03-20T01:53:11.360109904Z     await app(scope, receive, sender)
2024-03-20T01:53:11.360111549Z   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 758, in __call__
2024-03-20T01:53:11.360113375Z     await self.middleware_stack(scope, receive, send)
2024-03-20T01:53:11.360115073Z   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 778, in app
2024-03-20T01:53:11.360116757Z     await route.handle(scope, receive, send)
2024-03-20T01:53:11.360118480Z   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 299, in handle
2024-03-20T01:53:11.360120208Z     await self.app(scope, receive, send)
2024-03-20T01:53:11.360121963Z   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 79, in app
2024-03-20T01:53:11.360123684Z     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-03-20T01:53:11.360125840Z   File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-03-20T01:53:11.360127686Z     raise exc
2024-03-20T01:53:11.360129381Z   File "/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-03-20T01:53:11.360131029Z     await app(scope, receive, sender)
2024-03-20T01:53:11.360134626Z   File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 74, in app
2024-03-20T01:53:11.360136344Z     response = await func(request)
2024-03-20T01:53:11.360138011Z   File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 278, in app
2024-03-20T01:53:11.360139862Z     raw_response = await run_endpoint_function(
2024-03-20T01:53:11.360141544Z   File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 193, in run_endpoint_function
2024-03-20T01:53:11.360143390Z     return await run_in_threadpool(dependant.call, **values)
2024-03-20T01:53:11.360145082Z   File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 42, in run_in_threadpool
2024-03-20T01:53:11.360146735Z     return await anyio.to_thread.run_sync(func, *args)
2024-03-20T01:53:11.360148527Z   File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 56, in run_sync
2024-03-20T01:53:11.360150139Z     return await get_async_backend().run_sync_in_worker_thread(
2024-03-20T01:53:11.360151868Z   File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
2024-03-20T01:53:11.360153691Z     return await future
2024-03-20T01:53:11.360155371Z   File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 851, in run
2024-03-20T01:53:11.360157111Z     result = context.run(func, *args)
2024-03-20T01:53:11.360158657Z   File "/subgen/subgen.py", line 266, in receive_jellyfin_webhook
2024-03-20T01:53:11.360160443Z     titles(path_mapping(fullpath), transcribe_or_translate, True)
2024-03-20T01:53:11.360162143Z NameError: name 'titles' is not defined
McCloudS commented 4 months ago

You're right, not sure how that slipped through. Fixed it. Thanks for the heads-up. My next big lift is to eventually add unit testing so this doesn’t happen.