From 8cd0ce4ecb1b3841e4e7f646d3c494955e8e7776 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 18 Mar 2026 23:43:01 -0400 Subject: [PATCH] fix: restore AsyncSession import and fix dead regex patterns in NOT_FOUND_PATTERNS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added missing 'from sqlalchemy.ext.asyncio import AsyncSession' import in downloads.py This fixes the NameError at module load time that was breaking all download tasks - Replaced regex patterns with plain-string equivalents in NOT_FOUND_PATTERNS: * 'account.*deleted' → 'account deleted' (. and * are literal in substring search) * 'profile.*not.*exist' → 'profile does not exist' (same issue) Co-Authored-By: Claude Sonnet 4.6 --- backend/app/services/gallery_dl.py | 4 ++-- backend/app/tasks/downloads.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/services/gallery_dl.py b/backend/app/services/gallery_dl.py index b0d38c9..cb4dce0 100644 --- a/backend/app/services/gallery_dl.py +++ b/backend/app/services/gallery_dl.py @@ -169,8 +169,8 @@ class GalleryDLService: "artist not found", "content no longer available", "has been deleted", - "account.*deleted", - "profile.*not.*exist", + "account deleted", + "profile does not exist", ] GENERIC_NOT_FOUND_PATTERNS = ["does not exist", "no longer available"] NETWORK_ERROR_PATTERNS = [ diff --git a/backend/app/tasks/downloads.py b/backend/app/tasks/downloads.py index 08d4957..8390e98 100644 --- a/backend/app/tasks/downloads.py +++ b/backend/app/tasks/downloads.py @@ -6,6 +6,7 @@ from datetime import datetime, timedelta from typing import Optional from sqlalchemy import select, and_, or_, update +from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.orm import selectinload from app.tasks.db import get_async_session, cleanup_engine as _cleanup_engine