Add skip tracking, compressed heatmap, listening log, docs, tests, and OpenAI support

Major changes:
- Add skip tracking: poll currently-playing every 15s, detect skips (<30s listened)
- Add listening-log and sessions API endpoints
- Fix ReccoBeats client to extract spotify_id from href response
- Compress heatmap from 24 hours to 6 x 4-hour blocks
- Add OpenAI support in narrative service (use max_completion_tokens for new models)
- Add ListeningLog component with timeline and list views
- Update all frontend components to use real data (album art, play counts)
- Add docker-compose external network (dockernet) support
- Add comprehensive documentation (API, DATA_MODEL, ARCHITECTURE, FRONTEND)
- Add unit tests for ingest and API endpoints
This commit is contained in:
bnair123
2025-12-30 00:15:01 +04:00
parent faee830545
commit 887e78bf47
26 changed files with 1942 additions and 662 deletions

View File

@@ -0,0 +1,34 @@
"""Add skip tracking columns to play_history
Revision ID: a1b2c3d4e5f6
Revises: f92d8a9264d3
Create Date: 2025-12-29 22:30:00.000000
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "a1b2c3d4e5f6"
down_revision: Union[str, Sequence[str], None] = "f92d8a9264d3"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Add listened_ms, skipped, and source columns to play_history."""
op.add_column("play_history", sa.Column("listened_ms", sa.Integer(), nullable=True))
op.add_column("play_history", sa.Column("skipped", sa.Boolean(), nullable=True))
op.add_column("play_history", sa.Column("source", sa.String(), nullable=True))
# source can be: 'recently_played', 'currently_playing', 'inferred'
def downgrade() -> None:
"""Remove skip tracking columns."""
op.drop_column("play_history", "source")
op.drop_column("play_history", "skipped")
op.drop_column("play_history", "listened_ms")