Fix NFO service year extraction from series names

This commit is contained in:
2026-01-19 20:42:04 +01:00
parent 6d40ddbfe5
commit 01f828c799
3 changed files with 287 additions and 90 deletions

View File

@@ -120,85 +120,65 @@ For each task completed:
## TODO List:
fix:
Failed to load NFO/images for the-dreaming-boy-is-a-realist: No results found for: The Dreaming Boy is a Realist (2023)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/lukas/Volume/repo/Aniworld/src/server/services/background_loader_service.py:399 in │
│ \_load_nfo_and_images │
│ │
│ 396 │ │ │ │
│ 397 │ │ │ # Use existing NFOService to create NFO with all images │
│ 398 │ │ │ # This reuses all existing TMDB API logic and image downloading │
│ ❱ 399 │ │ │ nfo_path = await self.series_app.nfo_service.create_tvshow_nfo( │
│ 400 │ │ │ │ serie_name=task.name, │
│ 401 │ │ │ │ serie_folder=task.folder, │
│ 402 │ │ │ │ year=task.year, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ db = <sqlalchemy.ext.asyncio.session.AsyncSession object at 0x736aa1e0b770> │ │
│ │ e = TMDBAPIError('No results found for: The Dreaming Boy is a Realist (2023)') │ │
│ │ self = <src.server.services.background_loader_service.BackgroundLoaderService object at │ │
│ │ 0x736aa27556a0> │ │
│ │ task = SeriesLoadingTask( │ │
│ │ │ key='the-dreaming-boy-is-a-realist', │ │
│ │ │ folder='The Dreaming Boy is a Realist (2023)', │ │
│ │ │ name='The Dreaming Boy is a Realist (2023)', │ │
│ │ │ year=None, │ │
│ │ │ status=<LoadingStatus.LOADING_NFO: 'loading_nfo'>, │ │
│ │ │ progress={'episodes': True, 'nfo': False, 'logo': False, 'images': False}, │ │
│ │ │ started_at=datetime.datetime(2026, 1, 19, 19, 37, 20, 540721, │ │
│ │ tzinfo=datetime.timezone.utc), │ │
│ │ │ completed_at=None, │ │
│ │ │ error=None │ │
│ │ ) │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/lukas/Volume/repo/Aniworld/src/core/services/nfo_service.py:112 in create_tvshow_nfo │
│ │
│ 109 │ │ │ search_results = await self.tmdb_client.search_tv_show(serie_name) │
│ 110 │ │ │ │
│ 111 │ │ │ if not search_results.get("results"): │
│ ❱ 112 │ │ │ │ raise TMDBAPIError(f"No results found for: {serie_name}") │
│ 113 │ │ │ │
│ 114 │ │ │ # Find best match (consider year if provided) │
│ 115 │ │ │ tv_show = self.\_find_best_match(search_results["results"], serie_name, year) │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ download_fanart = True │ │
│ │ download_logo = True │ │
│ │ download_poster = True │ │
│ │ folder_path = PosixPath('/mnt/server/serien/Serien/The Dreaming Boy is a Realist │ │
│ │ (2023)') │ │
│ │ search_results = {'page': 1, 'results': [], 'total_pages': 1, 'total_results': 0} │ │
│ │ self = <src.core.services.nfo_service.NFOService object at 0x736aa273ce10> │ │
│ │ serie_folder = 'The Dreaming Boy is a Realist (2023)' │ │
│ │ serie_name = 'The Dreaming Boy is a Realist (2023)' │ │
│ │ year = None │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TMDBAPIError: No results found for: The Dreaming Boy is a Realist (2023)
INFO: 127.0.0.1:34916 - "POST /api/anime/search HTTP/1.1" 200
INFO: 127.0.0.1:34916 - "POST /api/anime/add HTTP/1.1" 500
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/anyio/streams/memory.py", line 98, in receive
return self.receive_nowait()
~~~~~~~~~~~~~~~~~~~^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/anyio/streams/memory.py", line 93, in receive_nowait
raise WouldBlock
anyio.WouldBlock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 78, in call_next
message = await recv_stream.receive()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/anyio/streams/memory.py", line 118, in receive
raise EndOfStream
anyio.EndOfStream
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/uvicorn/protocols/http/httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.scope, self.receive, self.send
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in **call**
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/fastapi/applications.py", line 1106, in **call**
await super().**call**(scope, receive, send)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/applications.py", line 122, in **call**
await self.middleware_stack(scope, receive, send)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/errors.py", line 184, in **call**
raise exc
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/errors.py", line 162, in **call**
await self.app(scope, receive, \_send)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 108, in **call**
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/Volume/repo/Aniworld/src/server/middleware/auth.py", line 209, in dispatch
return await call_next(request)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 108, in **call**
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/Volume/repo/Aniworld/src/server/middleware/setup_redirect.py", line 120, in dispatch
return await call_next(request)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/cors.py", line 91, in **call**
await self.simple_response(scope, receive, send, request_headers=headers)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/cors.py", line 146, in simple_response
await self.app(scope, receive, send)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/exceptions.py", line 79, in **call**
raise exc
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/starlette/middleware/exceptions.py", line 68, in **call**
await self.app(scope, receive, sender)
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/site-packages/fastapi/middleware/asyncexitstack.py", line 14, in **call**
async with AsyncExitStack() as stack:
~~~~~~~~~~~~~~^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/contextlib.py", line 768, in **aexit**
raise exc
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/contextlib.py", line 751, in **aexit**
cb_suppress = await cb(\*exc_details)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/lukas/miniconda3/envs/AniWorld/lib/python3.13/contextlib.py", line 271, in **aexit**
raise RuntimeError("generator didn't stop after athrow()")
RuntimeError: generator didn't stop after athrow()
2026-01-19 20:37:37 [debug ] Message broadcast failed_count=0 message_type=series_loading_update recipient_count=0
2026-01-19 20:37:37 [info ] Successfully loaded all data for series: the-dreaming-boy-is-a-realist
2026-01-19 20:37:37 [info ] Processing loading task for series: bel-blatt
2026-01-19 20:37:37 [debug ] Message broadcast failed_count=0 message_type=series_loading_update recipient_count=0
INFO: Creating NFO for Übel Blatt (2025) (year: None)