1. 29 Nov, 2026 3 commits
  2. 24 Nov, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Add guest browsing, onboarding profile fields, and a background job pipeline for uploads · fc4b4352
      Aryan Noshirvnai authored
      Home and Discovery now serve anonymous callers (get_current_user_optional)
      so unauthenticated visitors can browse and identify songs - Discovery's
      rate limiter keys off IP instead of user_id for guests, and the
      save/claim step is skipped entirely since there's no account to attach it
      to. UserProfile gains display_name/preferred_genres for the new 4-page
      onboarding (replacing the old 6-step tour), plus PATCH /auth/profile and
      POST /auth/profile/avatar to save them.
      
      POST /music/upload no longer blocks on the full identify/tag pipeline -
      it saves the file, creates an UploadJob, and hands identify/tag off to a
      BackgroundTasks job (mirroring RemixJob/ChatScanJob), returning
      {job_id, status} immediately. This is what lets the frontend upload
      several files concurrently instead of queuing each one behind the last,
      and what lets tagging keep running after the uploading tab closes - GET
      /music/upload/jobs is how the client finds out the result, including
      reconciling after a reload.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      fc4b4352
  3. 23 Nov, 2026 4 commits
    • Aryan Noshirvnai's avatar
      Fix upload 500: index sha256(fingerprint) instead of the raw fingerprint · 77eff0b8
      Aryan Noshirvnai authored
      Real uploads were failing with a 500 on prod's Postgres - "index row
      size 3184 exceeds btree version 4 maximum 2704" on both
      ix_library_songs_fingerprint and the IdentifiedTrack cache's unique
      index. A Chromaprint fingerprint for a long/complex track can run
      several KB, well past Postgres's btree row-size limit; SQLite never
      enforces that, so every local/dev upload worked fine until a real one
      hit Postgres. Dedup/cache lookups now filter on a new fingerprint_hash
      column (sha256, fixed 64 hex chars) instead - fingerprint itself stays
      on the row as unindexed reference data. Migration backfills existing
      rows in Python so it runs correctly against both SQLite and Postgres.
      77eff0b8
    • Aryan Noshirvnai's avatar
      Fetch cover art from Cover Art Archive for AcoustID matches · 73e00a51
      Aryan Noshirvnai authored
      AcoustID/MusicBrainz identify the recording but never carry artwork,
      so every AcoustID-sourced match showed no cover art at all even when
      Shazam-matched songs had one. Cover Art Archive (keyed by the same
      release MBID MusicBrainz already gives us) is the standard companion
      source - HEAD-checked before use so a release with nothing archived
      falls back to the existing null-coverart UI state instead of a broken
      image.
      73e00a51
    • Aryan Noshirvnai's avatar
      Disable AI identification fallback - too unreliable to keep in the live upload path · 91450d45
      Aryan Noshirvnai authored
      Per explicit instruction: Gemini's last-resort identification and
      genre-backfill calls are now gated behind a new AI_IDENTIFICATION_ENABLED
      flag, off by default. Shazam/AcoustID remain the only identification
      sources - a song neither can match now comes back unidentified
      immediately instead of waiting out an unreliable AI call first.
      91450d45
    • Aryan Noshirvnai's avatar
      Fix identification silently failing: swap overloaded gemini-3.7-flash for gemini-2.5-flash · db4acbbe
      Aryan Noshirvnai authored
      Uploads were coming back unidentified for any song Shazam couldn't
      match - AcoustID's key is independently broken (unrelated, already
      known), but the Gemini last-resort fallback was ALSO failing on every
      call, always timing out at the configured deadline. Direct testing
      against Google's API confirmed gemini-3.7-flash is currently returning
      503 "experiencing high demand" and the SDK's retry loop was burning the
      whole timeout before surfacing that. gemini-2.5-flash responds in
      single-digit seconds for the same audio and correctly identifies songs
      Shazam can't. Swapped in the 4 places that hardcoded the model name
      (music identification, inline genre backfill, remix planning, and the
      legacy Telegram bot's remix recipe).
      db4acbbe
  4. 22 Nov, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Add confidence scores and community-review gating for identified songs · b36805a8
      Aryan Noshirvnai authored
      Identified songs now carry a 0-100 confidence score. Accepting the
      system's identification needs no action; editing title/artist/album/
      genre instead flips the song to review_status "pending" ("community
      noted") - it stays fully visible and playable in the uploader's own
      library immediately, but is withheld from the shared library/Home feed
      for everyone else until a super admin approves or rejects it via the
      new review-queue endpoints. Also stops hitting Gemini when Shazam/
      AcoustID already found a real match, bounds Gemini's own request
      timeout, and fixes a dead lyrics-fetch guard that was wasting calls on
      blank queries.
      b36805a8
  5. 06 Nov, 2026 2 commits
    • Aryan Noshirvnai's avatar
      Move prod's primary datastore from SQLite to PostgreSQL · 4b5c72cd
      Aryan Noshirvnai authored
      SQLite was only ever meant for testing; prod now has real concurrent
      features (Rooms/DM chat, websockets) that benefit from proper
      multi-writer concurrency. Migrations were already dialect-agnostic (no
      op.batch_alter_table or sqlite_* kwargs anywhere), so this was a clean
      schema-only cutover - prod had zero real users, so nothing needed
      migrating, just a fresh `alembic upgrade head` against an empty Postgres
      database.
      
      Also fixed two real SQLite-only assumptions in database.py that the
      Postgres cutover exposed: `connect_args={"check_same_thread": False}`
      applied unconditionally (psycopg has no such option and raises on it),
      and the db-directory-creation logic ran DATABASE_URL through a
      sqlite-only string replace regardless of dialect. Both now scoped to an
      `_is_sqlite` check, matching the existing WAL-pragma guard.
      
      deploy.sh's automated .env regeneration path also had a silent
      `sqlite:///...` fallback for DATABASE_URL - removed in favor of a hard
      failure (same posture as JWT_SECRET) so a future CI deploy can never
      quietly revert prod back to SQLite by omission.
      
      Redis was considered (explicitly asked about) and deliberately not
      added: the only in-memory real-time state in Rooms/DMs is live
      WebSocket objects (can't live in Redis regardless, tied to one
      process's event loop) and small per-room ephemeral lists already
      documented as intentionally discardable - Redis's actual value only
      appears once there's more than one backend process, which isn't the
      case yet.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      4b5c72cd
    • Aryan Noshirvnai's avatar
      Route Pyrogram's MTProto connection through the SOCKS5 proxy too · 446f0f1f
      Aryan Noshirvnai authored
      HTTP_PROXY/HTTPS_PROXY only affect HTTP client libraries - Pyrogram talks
      to Telegram's datacenters over raw MTProto/TCP, which never respected
      those env vars. On a network that can't reach Telegram directly, every
      Client() call hung in an infinite "Connection timed out" retry loop -
      exactly what made Telegram linking "get stuck" on prod. Added a
      TELEGRAM_PROXY config (opt-in via TELEGRAM_PROXY_HOST, unset by default so
      dev's direct access needs no change) and passed it into all four
      pyrogram.Client() construction sites.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      446f0f1f
  6. 03 Nov, 2026 1 commit
  7. 13 Oct, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Fix global library search 403ing for non-admin users in Radio · 7f2abd19
      Aryan Noshirvnai authored
      GET /soundmarks/song-library backs SongPicker's "Public Library" tab, which
      RadioManageTab's "Add song" reuses for any station owner - but the endpoint
      was still gated get_current_business_admin from when only the business/admin
      panels used this picker. A plain user got a silent 403 (SongPicker swallows
      fetch errors into an empty "No songs found" state), so nothing looked broken,
      search just never returned anything. Relaxed to get_current_user, matching
      the earlier geocode/reverse-geocode fix for the identical reason - a plain
      title/artist search has nothing business-admin-specific about it.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      7f2abd19
  8. 12 Oct, 2026 3 commits
    • Aryan Noshirvnai's avatar
      Radio: stream from the live offset directly instead of seeking after the fact · 3ec09358
      Aryan Noshirvnai authored
      The old /radio/{id}/stream always served the file from byte 0 and relied on
      the frontend seeking afterward once it knew the duration - a visible delay
      before any audio played, and meaningless for a live broadcast with no stable
      timeline to seek within anyway. stream_audio_from_offset uses ffmpeg's
      demuxer-level -ss (seeks before decoding, -acodec copy avoids a re-encode) so
      the response itself starts exactly where the station actually is right now.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      3ec09358
    • Aryan Noshirvnai's avatar
      Replace Channels with Radio: band+frequency stations, stateless now-playing · 6c4cb3ed
      Aryan Noshirvnai authored
      Channels shipped a backend nobody built UI for (vibe sets/stories/showcase
      had zero frontend); removed outright rather than left half-built. Radio
      replaces it: creator-run stations tuned via a band (SM/SF/SR) + 50-200.0
      frequency dial, worldwide or local-radius broadcast, a queue that loops
      forever. No scheduler or background job anywhere in this codebase, so
      "now playing" is fully stateless - elapsed-time-since-creation modulo the
      queue's total duration maps deterministically to a (song, offset) pair,
      computed fresh on every request. LibrarySong gained duration_seconds
      (probed via pydub at tag/upload/claim/remix time, lazily backfilled for
      older rows) to make that math possible. Also relaxes /soundmarks/geocode
      and /reverse-geocode from business-admin-only to any authenticated user,
      needed by the new location picker and never actually business-specific.
      6c4cb3ed
    • Aryan Noshirvnai's avatar
      Add real invite code, PIN, and location discovery to Rooms · 7baf7ba5
      Aryan Noshirvnai authored
      Rooms were open-join-by-id only with no geo features, despite that being the
      intended design. Generates a unique invite code server-side on every create,
      adds an optional PIN (hashed like account passwords, rate-limited on guesses
      via a third reuse of AuthAttempt) gating join/stream/websocket alike, and adds
      optional lat/lon with a haversine-sorted nearby lookup (haversine itself
      extracted to a shared geo service once a second caller needed it).
      7baf7ba5
  9. 10 Oct, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Gate AI Remix behind a flag and add admin account moderation · f05e01b4
      Aryan Noshirvnai authored
      Remix is shelved until after beta launch: new REMIX_ENABLED config
      flag (off by default) returns 403 from both /remix endpoints, mirroring
      the frontend's existing VITE_ENABLE_REMIX gate. Full test coverage on
      the underlying pipeline is preserved via an autouse fixture that force-
      enables the flag for every existing test except the two new ones
      covering the disabled response.
      
      Admins can now moderate accounts: new User.is_active and
      suspended_until columns back a soft-delete design (no FK cascades
      exist anywhere in this schema, so a real row delete would orphan 20+
      tables) enforced everywhere identity is resolved - login, refresh,
      every authenticated request, and websockets - not just at login.
      New endpoints extend the existing admin user list: username search,
      rename, deactivate/reactivate, suspend/unsuspend, and password reset.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      f05e01b4
  10. 08 Oct, 2026 1 commit
  11. 07 Oct, 2026 2 commits
    • Aryan Noshirvnai's avatar
      Skip embedded ID3v2 cover art when streaming audio for playback · 2f562691
      Aryan Noshirvnai authored
      Uploaded mp3s carry an ID3v2 tag that's almost entirely embedded cover
      art - tens to hundreds of KB a player must get through before reaching
      the first real audio frame, even though the player already gets artwork
      from the separate coverart field and never touches the embedded copy.
      Adds a shared stream_audio_file() helper that computes the tag's byte
      offset and serves everything after it as the logical resource (Range
      math included, so seeking is unaffected), and wires it into all 5
      playback-stream endpoints that previously used plain FileResponse.
      Also adds a long-lived Cache-Control, since every file lives at a
      unique generated path and is never rewritten after upload.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      2f562691
    • Aryan Noshirvnai's avatar
      Home feed: dedupe songs/albums across uploaders, drop uploader attribution · 44617a06
      Aryan Noshirvnai authored
      Every section (New Songs, New Albums, Suggestions) is now deduped by
      (title, artist)/(album, artist) identity - the same song or album tagged by
      several different users used to eat one display slot per uploader, now
      shows once. Albums merge across uploaders by picking a single
      representative copy (the caller's own if they have one, so the card still
      navigates directly instead of needing a claim; otherwise the most recent) -
      never literally merging different people's track data together.
      
      No uploader identity (username) is attached to any global-feed entry
      anymore - the feed reads as one shared pool of music. New `is_liked` field
      lets the frontend show a real favorite heart on Home rows; the helper that
      computes it (liked_song_ids) moved out of library.py into
      services/favorites.py so home.py can reuse it without importing another
      router's private function, same reasoning give_from_shared_library was
      already split out for.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      44617a06
  12. 06 Oct, 2026 1 commit
  13. 13 Sep, 2026 1 commit
  14. 06 Sep, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Add shared-library search: /library/shared/search + /library/shared/claim · cab57b31
      Aryan Noshirvnai authored
      Every library query was scoped to the caller's own songs - there was no
      way to search what other users have already tagged. New search endpoint
      matches title/artist/genre across every user's library (same matching as
      the existing owner-scoped search), deduped by (title, artist) so a song
      several users separately uploaded doesn't show up once per owner, and
      excludes anything the caller already has by that same identity - the
      point is surfacing music that's new to them, not re-offering their own
      library back at them.
      
      Claiming a result reuses give_from_shared_library - the exact mechanism
      already backing Discovery's "identified something someone else has, give
      me a copy" flow - moved out of discovery.py into a new shared services
      module so both routers call the same code instead of one importing the
      other's private function. Picked up a drive-by fix in the move: it wasn't
      copying track_number, so a claimed song silently lost its real album
      order.
      
      Also fixed two unrelated pre-existing test collisions surfaced while
      adding these tests: the session-scoped test DB (no per-test rollback)
      meant test_music.py, test_discovery.py, and this file's own new tests all
      used identical "Shared Song"/"Shared Artist"-style literals, and a global
      (no user_id) title/artist lookup could resolve to the wrong test's
      leftover row depending on run order.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      cab57b31
  15. 03 Sep, 2026 3 commits
  16. 01 Sep, 2026 3 commits
  17. 31 Aug, 2026 2 commits
    • Aryan Noshirvnai's avatar
      Fix synced lyrics being silently skipped during tagging · 34fe74d2
      Aryan Noshirvnai authored
      The synced-lyrics lookup was only attempted when the identification
      candidate had no plain lyrics of its own - but Shazam and Gemini can
      both independently return a plain snippet as part of identification,
      which was short-circuiting the sync fetch entirely and silently
      discarding real timing data that was actually available. Now always
      attempted, with synced data (when found) always winning over whatever
      plain-text source identification provided.
      
      Also fixes the Discovery "give from shared library" path, which
      copied a source song's plain lyrics but not its synced_lyrics -
      copies given via Discovery were silently losing sync data even when
      the source had it.
      
      Existing tests never caught this because they always constructed a
      candidate with lyrics already stripped out; also fixes a shared
      mutable test fixture (FAKE_CANDIDATE) that the code under test
      mutates in place, which was silently leaking state between tests.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      34fe74d2
    • Aryan Noshirvnai's avatar
      Real line-synced lyrics: stop discarding LRC timing, store it · ae06a8fd
      Aryan Noshirvnai authored
      fetch_lyrics() now tries syncedlyrics with synced_only=True first (a real
      line-by-line-timed hit, not a fuzzy fallback) and only drops to plain-text
      search if nothing timed exists anywhere. Previously it always stripped
      timestamps immediately, throwing away data the frontend now needs for a
      real Spotify-style highlighted lyrics view.
      
      New synced_lyrics column (LibrarySong + IdentifiedTrack cache), JSON-encoded
      [[seconds, text], ...], threaded through the shared _identify_tag_and_store
      pipeline (upload, tag, and the Telegram bulk-scan job all go through it) and
      exposed via GET /library/lyrics/{file_id}.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      ae06a8fd
  18. 28 Aug, 2026 2 commits
    • Aryan Noshirvnai's avatar
      Switch all Gemini calls from 2.5-flash to 3.7-flash · 4d1f15ee
      Aryan Noshirvnai authored
      Genre fallback (music.py), Discovery's AI identification (music_identification.py),
      remix planning (remix_engine.py), and the Telegram bot's remix recipe parser
      (ai_remix.py) all move to the current flash model. Verified gemini-3.7-flash is a
      real, listed model for this API key via a live generateContent call before
      switching (returned a transient 503 "high demand" on first probe, not a 429/403
      access-denial - confirmed the key itself is fine with a control call against the
      old model in the same window).
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      4d1f15ee
    • Aryan Noshirvnai's avatar
      Discovery: give a match from any user's library, real confidence field; rate limit /remix · b1f5d610
      Aryan Noshirvnai authored
      Discovery hits now check the whole app's library (not just the caller's own) - if
      someone else (including a super-admin seed upload) already has the song, the finder
      gets their own LibrarySong row immediately, reusing the existing file_path rather
      than duplicating audio on disk. The library is built entirely from real uploads,
      never anything auto-downloaded, so this stays clear of the copyright concern raised
      earlier.
      
      AcoustID's match score and a fixed value for Shazam are now a real queryable
      confidence field on DiscoveredSong instead of embedded in a source string.
      
      POST /remix had no rate limiting despite being the one genuinely expensive endpoint
      (real Gemini spend + CPU-bound Demucs per call) - added the same DB-backed limiter
      pattern used elsewhere, reusing RemixJob.created_at as its own counter.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      b1f5d610
  19. 23 Aug, 2026 1 commit
  20. 22 Aug, 2026 4 commits
  21. 19 Aug, 2026 1 commit
    • Aryan Noshirvnai's avatar
      Add bulk Telegram chat scanning: approve a chat, tag+save every song in it · 00214e85
      Aryan Noshirvnai authored
      New foundation for scanning a whole chat instead of one song at a time:
      ApprovedChat (opt a chat in) and ChatScanJob (a background job that
      lists a chat's music, then downloads+identifies+tags+saves each song
      via the same pipeline /music/tag already uses per song). Mirrors
      RemixJob's proven pattern - a status column + BackgroundTasks, no new
      task-queue infrastructure - rather than inventing a new one.
      
      Deliberately on-demand (user approves a chat, then triggers one scan)
      rather than automatic background polling, which needs a materially
      different architecture (persistent per-user Telegram connections or a
      scheduler) not worth building until on-demand proves out the feature.
      
      Guardrails baked in from the start rather than bolted on later: a
      50-message cap per scan, a 5-scans/day per-user cap, no two concurrent
      scans of the same chat, and a 1.5s pause between songs so a scan reads
      like a real user, not a script hammering Telegram/AcoustID/Gemini.
      Per-song outcomes (saved/skipped_duplicate/failed) are tracked
      individually in results_json, not just one pass/fail for the whole job.
      
      _identify_tag_and_store's request param is now optional so the
      background job can call it without a live HTTP request in scope - same
      reasoning as RemixJob storing a bare filename instead of a full URL.
      Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
      Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
      00214e85
  22. 18 Aug, 2026 1 commit