Goon — self-hosted aggregator for adult-content scene metadata. Indexes scenes from TPDB, StashDB, and 30+ public adult tube sites. Cross-source deduplication via perceptual hash + Levenshtein distance. FastAPI backend + APScheduler worker + React Native (Expo) mobile client. FOSS, ad-free, donation-funded. See README for details.
42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
"""scene_play_progress — pozycja odtwarzania per scena (continue watching).
|
|
|
|
Revision ID: 0007_play_progress
|
|
Revises: 0006_blacklists
|
|
Create Date: 2026-05-04
|
|
|
|
Single-user; tabela trzyma ostatnio oglądane sceny + (gdy player zwróci) pozycję
|
|
w sekundach. Continue watching rail na home pobiera top-N ostatnich.
|
|
"""
|
|
from collections.abc import Sequence
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0007_play_progress"
|
|
down_revision: str | None = "0006_blacklists"
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"scene_play_progress",
|
|
sa.Column("scene_id", sa.dialects.postgresql.UUID(as_uuid=True),
|
|
sa.ForeignKey("scenes.id", ondelete="CASCADE"),
|
|
primary_key=True),
|
|
sa.Column("position_sec", sa.Integer(), nullable=False, server_default="0"),
|
|
sa.Column("duration_sec", sa.Integer(), nullable=True),
|
|
sa.Column("finished", sa.Boolean(), nullable=False, server_default=sa.false()),
|
|
sa.Column("last_played_at", sa.DateTime(timezone=True),
|
|
server_default=sa.func.now(), nullable=False),
|
|
)
|
|
op.create_index(
|
|
"ix_scene_play_progress_last_played_at",
|
|
"scene_play_progress",
|
|
["last_played_at"],
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_scene_play_progress_last_played_at", table_name="scene_play_progress")
|
|
op.drop_table("scene_play_progress")
|