From b5c3bfddc8b8df8747792517dd6fc8a6f3a55f6f Mon Sep 17 00:00:00 2001 From: arabcoders Date: Thu, 29 Jan 2026 16:51:43 +0300 Subject: [PATCH] fix: only add batch extras when there are more than one item being processed. --- app/routes/api/history.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/routes/api/history.py b/app/routes/api/history.py index 44337f38..056e9db3 100644 --- a/app/routes/api/history.py +++ b/app/routes/api/history.py @@ -425,14 +425,12 @@ async def items_add(request: Request, queue: DownloadQueue, encoder: Encoder) -> if not item.extras: item.extras = {} - item.extras["batch_id"] = batch_id - item.extras["batch_index"] = idx - item.extras["batch_total"] = len(items) + if len(items) > 1: + item.extras["batch_id"] = batch_id + item.extras["batch_index"] = idx + item.extras["batch_total"] = len(items) - task = asyncio.create_task( - queue.add(item=item), - name=f"bulk_add_{batch_id}_{idx}", - ) + task = asyncio.create_task(queue.add(item=item), name=f"bulk_add_{batch_id}_{idx}") task.add_done_callback(lambda t: handle_task_exception(t, LOG)) return web.json_response(