diff --git a/backend/alembic/versions/0100_drop_plex_item_markers.py b/backend/alembic/versions/0100_drop_plex_item_markers.py new file mode 100644 index 00000000..03991be6 --- /dev/null +++ b/backend/alembic/versions/0100_drop_plex_item_markers.py @@ -0,0 +1,22 @@ +"""plex_items: drop `markers`, a column nothing writes or reads + +Intro/credits markers are read live from Plex for the item the player opens (with Plex's `final` flag +on the block that ends it); this cached copy was never filled — every row is NULL. The downgrade +restores the empty column. +""" + +import sqlalchemy as sa +from alembic import op + +revision: str = "0100_drop_plex_item_markers" +down_revision: str | None = "0099_library_states" +branch_labels: str | None = None +depends_on: str | None = None + + +def upgrade() -> None: + op.drop_column("plex_items", "markers") + + +def downgrade() -> None: + op.add_column("plex_items", sa.Column("markers", sa.JSON(), nullable=True)) diff --git a/backend/app/models.py b/backend/app/models.py index b8b1a4fb..1a4e06db 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -1274,9 +1274,6 @@ class PlexItem(Base, TimestampMixin, UpdatedAtMixin): # bit-depth/HDR. NULL = never (the backfill's work-list). Only HW-decodable transcode items are # probed (the rest are SW-only by codec and need no bit-depth); see `_probe_media_batch`. media_probed_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True)) - # Intro/credit markers: [{"type": "intro"|"credits", "start_s": int, "end_s": int}, ...] — unused: - # the player reads them live from Plex (`routes/plex/detail.item_detail`, with Plex's `final`). - markers: Mapped[list | None] = mapped_column(JSON) added_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), index=True) # Filterable / orderable metadata mirrored from the Plex section listing (no extra API calls; # `rating` = Plex audienceRating, which is ~the IMDb score). The arrays back genre/person/studio