mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-26 19:40:51 +08:00
fix(offset): only suggest episode_offset for virtual seasons
- Change episode_offset type from int to int | None - Only set episode_offset when virtual season split is detected - For simple season mismatches (e.g., RSS S2 → TMDB S1), episode_offset is now None - Improve reason messages to clarify when episode offset is/isn't needed - Update database migration version to 7 and add migration check Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
|
||||
TABLE_MODELS: list[type[SQLModel]] = [Bangumi, RSSItem, Torrent, User, Passkey]
|
||||
|
||||
# Increment this when adding new migrations to MIGRATIONS list.
|
||||
CURRENT_SCHEMA_VERSION = 6
|
||||
CURRENT_SCHEMA_VERSION = 7
|
||||
|
||||
# Each migration is a tuple of (version, description, list of SQL statements).
|
||||
# Migrations are applied in order. A migration at index i brings the schema
|
||||
@@ -183,6 +183,10 @@ class Database(Session):
|
||||
columns = [col["name"] for col in inspector.get_columns("torrent")]
|
||||
if "qb_hash" in columns:
|
||||
needs_run = False
|
||||
if "bangumi" in tables and version == 7:
|
||||
columns = [col["name"] for col in inspector.get_columns("bangumi")]
|
||||
if "suggested_season_offset" in columns:
|
||||
needs_run = False
|
||||
if needs_run:
|
||||
with self.engine.connect() as conn:
|
||||
for stmt in statements:
|
||||
|
||||
Reference in New Issue
Block a user