commits
* feat: add offline mode foundation with auto-download liked tracks
- add storage.ts with Cache API + IndexedDB for offline audio storage
- add GET /audio/{file_id}/url endpoint returning direct R2 URLs for caching
- add auto_download_liked preference (stored in localStorage, device-specific)
- add settings toggle that bulk-downloads all liked tracks when enabled
- auto-download new tracks when liking (if preference enabled)
- Player component checks for cached audio before streaming
- fix TLFM reauth notice to show correct message
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: require auth for audio URL endpoint
adds authentication to GET /audio/{file_id}/url to prevent
unauthenticated enumeration of audio URLs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: improve IndexedDB robustness
- close database connections after each operation (fixes connection leak)
- deduplicate concurrent downloads using in-flight promise map
- verify cache entry exists in isDownloaded() and clean up stale metadata
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: move auto-download toggle to experimental section
keeps the feature available but clearly marked as experimental
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add offline mode foundation with auto-download liked tracks
- add storage.ts with Cache API + IndexedDB for offline audio storage
- add GET /audio/{file_id}/url endpoint returning direct R2 URLs for caching
- add auto_download_liked preference (stored in localStorage, device-specific)
- add settings toggle that bulk-downloads all liked tracks when enabled
- auto-download new tracks when liking (if preference enabled)
- Player component checks for cached audio before streaming
- fix TLFM reauth notice to show correct message
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: require auth for audio URL endpoint
adds authentication to GET /audio/{file_id}/url to prevent
unauthenticated enumeration of audio URLs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: improve IndexedDB robustness
- close database connections after each operation (fixes connection leak)
- deduplicate concurrent downloads using in-flight promise map
- verify cache entry exists in isDownloaded() and clean up stale metadata
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: mobile modal positioning to use full screen
On mobile, modals were getting cut off due to Safari sticky+fixed
positioning issues. Changed from center-based positioning to inset-based
(top/left/right/bottom) to use the full available screen space.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use svelte-portal for modal positioning
the header's backdrop-filter creates a CSS containing block, which
causes position:fixed modals to be positioned relative to the header
instead of the viewport. use svelte-portal to render modals directly
on document.body, preserving proper centering.
- add svelte-portal dependency
- apply use:portal={'body'} to LinksMenu and ProfileMenu modals
- add docs/frontend/portals.md documenting this pattern
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
The layout was rendering default OG tags even for tag pages because
/tag/ wasn't in the hasPageMetadata list, causing crawlers to use
the first (default) tags instead of the page-specific ones.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- add +page.server.ts for SSR tag metadata (name, track count)
- add og:title, og:description, twitter:card meta tags
- keep tracks fetched client-side to preserve auth state
- link previews now show "X tracks tagged #tagname"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- use "internet handle" label with link to internethandle.org
- collapsible FAQ sections for explanation
- simpler "sign in" button
- cleaner spacing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Audio update covering Dec 8-17:
- Glass effects and custom background images
- Accurate AudD cost tracking from track duration
- Moderation agent with audit trails
- Performance improvements (removed slow moderation calls)
- iOS Safari fixes, sticky header, album track order preservation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
reverts PR #529. the letta account has been discontinued, so reverting
to the original claude-code-action workflow.
changes:
- restore .github/workflows/status-maintenance.yml to use anthropics/claude-code-action@v1
- delete scripts/status_maintenance.py (letta-backed script)
- delete scripts/letta_status_agent.py (local testing script)
- update STATUS.md to remove letta references
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- calculate API requests from track duration (1 request = 12s audio)
- remove hardcoded Nov 24 fallback - now fully dynamic from DB
- add new fields: requests_this_period, base_cost, overage_cost, billable_requests
- update daily chart to show requests instead of scan count
- change GHA workflow from daily to hourly for near real-time visibility
- update frontend to display request-based metrics with explainer text
AudD billing: $5/mo base + $5/1k requests over 6000 free tier
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- adds upload link between library and @handle in desktop nav
- styled with accent border/color as primary CTA
- hover fills with accent background
- hidden when already on /upload page
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- add pointer-events: none to body::before (fixes input blocking)
- remove disabled state from background URL input (can set fallback)
- fix toast message when toggling playing artwork off
- update descriptions to clarify fallback behavior
- always show tile checkbox when background URL is set
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- visual customization section (PRs #595-596): custom backgrounds, glass effects
- added #557 to album management (slug sync fix)
- added #549 to costs dashboard (dedicated R2 bucket)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the translateZ transform was causing tracks to overlap each other
in 3D space, blocking click events on like/share buttons for all
tracks below the first one. the queue button worked because it was
positioned differently in the layout.
removed the wheel effect entirely - the visual effect wasn't worth
the broken interactivity.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add glass effects and track item styling
- add CSS variables for glass effects (--glass-bg, --glass-blur, --glass-border)
- apply backdrop-filter blur to Player, Header, and Queue sidebar
- add translucent backgrounds to TrackItem without blur (performance safe)
- add subtle border-radius (6px) and box-shadow to track items
- support both dark and light themes with appropriate glass values
- remove conflicting light theme overrides in favor of CSS variables
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add ui_settings JSONB column for extensible preferences
- add ui_settings JSONB column to user_preferences table
- update preferences API to expose ui_settings field
- merge ui_settings on partial updates to support incremental changes
- add migration for new column
- add tests for ui_settings CRUD and persistence
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add background image settings UI
- add UiSettings interface with background_image_url and background_tile
- add background image URL input and tile toggle in settings page
- apply background image via CSS custom properties in layout
- update preferences manager with updateUiSettings method
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: refine track item hover behavior and glass styling
- remove chunky left border, use uniform subtle border
- add tactile hover: 0.5px lift with accent-tinted glow
- smooth cubic-bezier easing for polished feel
- active state settles back down on click
- adjust track background opacity (88%) for better balance
- fix background image input reactivity bug
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add subtle 3D wheel scroll effect to track items
tracks now appear on a convex cylinder surface:
- items at viewport center are closest
- items above/below rotate away slightly (2° max)
- uses passive scroll listener for performance
- transform-style: preserve-3d for proper layering
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: glass button styling for background image visibility
icon buttons now have translucent backgrounds when a
background image is set, ensuring they remain visible
against any background:
- ShareButton gets glass background
- playlist page icon-btn (edit, delete) gets glass bg
- HiddenTagsFilter eyeball toggle gets glass bg
- glass button CSS variables set dynamically in layout
when background image is present
- respects light/dark theme with appropriate opacity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: consistent glass button styling and preserve bg image on refresh
- unified queue/action buttons across tag, liked, playlist, and album pages
to use glass button CSS variables (--glass-btn-bg, --glass-btn-border)
- only apply background image changes when preferences are actually loaded
to prevent clearing the background image on refresh/hydration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: use playing track artwork as background option
adds a new toggle in settings to use the currently playing
track's artwork as the background image:
- new ui_settings.use_playing_artwork_as_background option
- when enabled, overrides custom background image URL
- background changes dynamically as tracks change
- disables the custom URL input when enabled
- playing artwork never tiles (always cover)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: blur and tile playing artwork background
- playing artwork now tiles in a 4x4 grid (25% size)
- applies 40px blur for smooth, ambient effect
- uses body::before pseudo-element with scale(1.1) to prevent blur edge artifacts
- custom background images remain unblurred
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: fall back to custom bg when playing track has no artwork
when "use playing artwork as background" is enabled but the
current track has no artwork, now falls back to the custom
background URL if one is set (instead of showing nothing)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add subtle text glow for readability against backgrounds
adds a --text-shadow CSS variable that provides a soft glow effect
around gray metadata text when a background image is set. this improves
readability without being visually heavy like a drop shadow.
applied to:
- album page metadata (type, title, meta, artist link)
- tag page track count subtitle
- settings page section headers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use proper fallbacks for glass button styling
when no background image is set, buttons should fall back to
transparent backgrounds and standard border colors rather than
hardcoded dark theme glass values.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
STATUS.md:
- added missing section for Dec 10-12 work (PRs #558-572)
- documents background task expansion (like/comment PDS writes, album sync)
- documents Redis cache for copyright labels (PR #566)
- documents mobile UX improvements and misc fixes
background-tasks.md:
- added new tasks: album list sync, PDS like/unlike, PDS comment CRUD
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: make header sticky on scroll
- change overflow-x from hidden to clip on .app-layout to preserve
position: sticky on descendants
- add position: sticky and background to header so it sticks to top
when scrolling through long lists
previously, scrolling down a long track list required scrolling all the
way back up to access search or navigation. now the header stays visible.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update STATUS.md with Dec 14-15 work
- performance improvements (PRs #590-591)
- moderation agent (PRs #586, #588)
- bug fixes (PRs #589, #592, #593)
- iOS Safari fixes (PRs #573-576)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: preserve album track order during ATProto sync (#587)
when syncing album list records to ATProto, the background sync was
always ordering tracks by created_at, overwriting any custom order
the user had set via the frontend reorder feature.
now the sync:
1. fetches the existing ATProto list record order (if any)
2. preserves that order for existing tracks
3. appends any new tracks at the end (sorted by created_at)
this prevents user-reordered albums from reverting on login.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use unique DID and cleanup in test to avoid CI conflicts
the test was sharing fixtures with fixed DIDs causing foreign key
constraint violations during teardown when running in parallel with xdist.
now uses:
- unique DID with uuid suffix for test isolation
- explicit cleanup in finally block (tracks → albums → artists order)
- properly typed capture function for lint compliance
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
same issue as /tracks/ - copyright info is only displayed in artist
portal, not public tag browse pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the copyright check was making an HTTP call to moderation.plyr.fm on
every /tracks/ request, adding ~1 second latency. this info is only
displayed in /tracks/me (artist portal), not the main feed.
- remove get_copyright_info from main listing endpoint
- keep it in /tracks/me and /tracks/me/broken where it's needed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the playlist endpoint wasn't checking for authenticated users, so
tracks always showed is_liked: false even when the user had liked them.
backend:
- add session cookie check to GET /lists/playlists/{id}
- query user's liked tracks when authenticated
- pass liked_track_ids to TrackResponse.from_track()
frontend:
- add client-side liked state hydration (matching artist page pattern)
- prime from localStorage cache, then fetch fresh data
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- update prompt to de-emphasize unreliable match scores
- focus analysis on title/artist name matching instead
- remove 200 char truncation on reasoning notes
- make resolution notes use full card width in admin UI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- add AI-powered moderation agent (scripts/moderation_agent.py) that:
- fetches pending copyright flags from moderation service
- uses Claude to categorize as violation/false positive/needs review
- shows reasoning for each decision in scannable table format
- bulk resolves false positives with human approval
- fix JSON API endpoint to store resolution reason and notes
(previously only the htmx endpoint saved this data)
- update admin UI to display resolution notes prominently
for resolved items instead of hiding in tooltip
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
documents the confidential OAuth client implementation:
- PR #578: initial confidential client support
- PRs #580-582: bug fixes for aud claim and kid header
- fork updates for issuer and kid parameters
- outcome: 180-day refresh tokens, remember-me working
- links to #583 for future account switching work
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the ATProto OAuth spec requires client assertions to include the kid
in the JWT header so the PDS knows which public key to use for
verification.
changes:
- rename _load_client_secret_key() to _load_client_secret()
- return tuple of (key, kid) instead of just key
- validate that OAUTH_JWK includes kid field
- pass client_secret_kid to OAuthClient
- update atproto fork to v0.0.1.dev470 with kid support
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
python-jose's to_dict() doesn't include the kid field from the
original JWK. this fix explicitly copies the kid from the input
JWK to the public key output.
the kid is required by ATProto OAuth for key identification when
validating client assertions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- update atproto fork to include aud claim fix (dfbaf00)
- client assertion JWT now uses issuer (not token endpoint) as aud claim
- this fixes "unexpected aud claim value" errors with confidential clients
- fix tests to explicitly mock OAUTH_JWK setting
- tests were relying on env not having OAUTH_JWK set, but dev env has it
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add confidential OAuth client support for longer-lived sessions
adds support for ATProto OAuth confidential clients using private_key_jwt
authentication. when OAUTH_JWK is configured, the client authenticates
with a cryptographic key, earning 180-day refresh tokens (vs 2-week for
public clients).
changes:
- add OAUTH_JWK setting to AtprotoSettings for ES256 private key
- update OAuthClient to pass client_secret_key when configured
- add /.well-known/jwks.json endpoint for public key discovery
- update /oauth-client-metadata.json to include confidential client fields
- add scripts/gen_oauth_jwk.py utility to generate keys
- add tests for is_confidential_client() and get_public_jwks()
to enable:
1. run: uv run python scripts/gen_oauth_jwk.py
2. add output to .env as OAUTH_JWK='...'
closes #577
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* address review comments: remove deferred imports, add type annotations
- move imports to top level in main.py (is_confidential_client, get_public_jwks, HTTPException)
- add type annotation to metadata variable: dict[str, Any]
- update return types to dict[str, Any]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add OAuth confidential client documentation
explains what confidential clients are, why they matter for plyr.fm,
and how the implementation works. includes sources and key rotation
guidance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add token refresh mechanism and migration notes
- explain how token refresh works (trigger, detection, refresh, retry)
- document what gets refreshed (access vs refresh tokens)
- add observability notes (logfire log messages)
- document migration impact for existing sessions
- clarify that existing tokens can't be upgraded (2-week refresh limit)
- note that only 3 internal dev tokens affected in production
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* debug: add console logs to AddToMenu for iOS Safari debugging
Logs:
- toggleMenu called with menuOpen state and viewport size
- dropdown element presence check
- computed styles (position, z-index, display, visibility, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: override open-upward class in mobile media query
The .open-upward class was setting top: auto and bottom: calc(100% + 4px)
which wasn't being overridden by the mobile media query's .menu-dropdown
styles, causing the dropdown to render at top: -218px (off-screen).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Logs:
- toggleMenu called with menuOpen state and viewport size
- dropdown element presence check
- computed styles (position, z-index, display, visibility, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- bump z-index above Player (backdrop: 199, dropdown: 200)
- add translateZ(0) to force GPU layer and fix iOS stacking context
- add explicit width constraints
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- center share button on album detail page mobile view
- fix album grid overflow on narrow mobile screens using min()
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
without an explicit id, iOS may conflate different PWAs when routing
media session events. this caused tapping track metadata in control
center to open the wrong home screen app (leaflet.pub instead of plyr.fm).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- AddToMenu now includes queue and share actions (matching TrackActionsMenu)
- Both menus open from top on mobile instead of bottom (doesn't cover player)
- Added backdrop for proper dismissal on mobile
- Track detail page passes shareUrl and onQueue props to AddToMenu
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add redis cache for copyright label lookups
the moderation service call was causing 2-3s latency spikes on GET /tracks/
in production. since we have multiple fly.io instances, in-memory caching
wouldn't work - added distributed redis cache (reusing docket's redis).
- add backend/utilities/redis.py for async client from docket URL
- cache active label status with 5min TTL (matches queue cache)
- use mget/pipeline for efficient batch operations
- invalidate cache when labels are emitted
- fail closed on errors (treat as active)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: move cache settings to config, add async context manager
- add label_cache_prefix and label_cache_ttl_seconds to ModerationSettings
- add async_redis_client() context manager for isolated connections
- add clear_client_cache() for test cleanup
- remove hardcoded cache constants from moderation.py
- fix tests to properly clear client cache between runs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* test: add redis isolation for xdist parallel tests
- add redis_database fixture that assigns different DB per worker
- use unique URIs in cache tests to avoid cross-test pollution
- document redis test isolation pattern in docs/testing/README.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: handle missing redis gracefully in test fixture
the redis_database fixture now catches ConnectionError and skips
silently when redis is unavailable. tests that don't need redis
will pass, and tests that do need it will fail with specific errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: mock settings in moderation cache tests
tests that mock httpx must also mock settings.moderation to avoid
early return on auth_token check. without this, tests pass locally
(where MODERATION_AUTH_TOKEN may be set) but fail in CI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use D: prefix for DOCKET_URL to allow CI override
pytest-env's D: prefix means "default" - only set if not already
set by the environment. this allows CI's DOCKET_URL=redis://localhost:6379
to take precedence over pyproject.toml's 6380 (for local docker-compose).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: move deferred imports to top of file, add type hints
- move redis imports to module level in moderation.py
- move asyncio import to module level in redis.py
- add type hint for kwargs dict in redis.py
- move imports to module level in conftest.py
- add rule to AGENTS.md: DO NOT UNNECESSARILY DEFER IMPORTS
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Add APP_STAGE constant to branding.ts (configurable via VITE_APP_STAGE)
and display it as a superscript badge next to the app name in the header.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add atprotofans support link mode
adds three support link modes for artist profiles:
- none: no support link displayed
- atprotofans: links to atprotofans.com/profile/{handle}
- custom: user-provided https:// URL (existing behavior)
backend:
- validate support_url accepts 'atprotofans' magic value
- reject non-https URLs for custom links
- add tests for all three modes
frontend:
- portal page: radio button selector for support link mode
- artist profile: compute actual URL from mode + handle
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: validate atprotofans eligibility before selection
checks user's PDS for com.atprotofans.profile/self record with
acceptingSupporters=true before allowing atprotofans selection.
- client-side check on portal load (no backend sprawl)
- shows "set up" link when not eligible
- shows "ready" when eligible
- disables option when ineligible
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use ATProto SDK for proper handle/PDS resolution
- add @atproto/api SDK to frontend for proper ATProto operations
- fix portal atprotofans eligibility check to resolve DID to PDS first
- fix backend handles.py to use AsyncIdResolver instead of bsky.social
- fix frontend error.svelte to use SDK for handle resolution
the issue was hardcoded bsky.social URLs which don't work for users
on self-hosted PDS instances. now we properly resolve DIDs via
plc.directory and query the user's actual PDS.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: show 'profile ready' as link to atprotofans profile
when eligible, the status now shows "profile ready" as a clickable
link to the user's actual atprotofans profile page.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct atprotofans URL to use /u/{did} not /profile/{handle}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: move like and comment PDS writes to background tasks
Likes:
- Update like/unlike endpoints to use optimistic DB writes
- Schedule PDS record operations via docket background tasks
- Make atproto_like_uri nullable to support async PDS writes
- Update tests to verify background task scheduling
Comments:
- Update create/update/delete comment endpoints to use optimistic DB writes
- Schedule PDS record operations via docket background tasks
- Make atproto_comment_uri nullable to support async PDS writes
- Update tests to verify background task scheduling
This reduces API response times by moving slow PDS writes to the background
while keeping the UI responsive with immediate local database updates.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: move deferred imports to module level
Move imports that were unnecessarily deferred inside PDS task functions
to the top of the module for clarity.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
the default docket worker polls redis every 250ms (4x/sec), which
caused ~3.4M redis commands in 2 days and $6.73 in upstash costs.
changes:
- add check_interval_seconds and scheduling_resolution_seconds to DocketSettings
- default both to 5 seconds (20x reduction in polling frequency)
- update background.py Worker to use these settings
- update audd costs in export_costs.py ($3.91 -> $9.13 for current period)
expected redis cost reduction: ~95% for idle polling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
adds sync_album_list task to sync album ATProto list records immediately
after track operations, rather than waiting for the user's next login.
changes:
- add sync_album_list task and schedule_album_list_sync to background_tasks.py
- refactor _register_tasks to use docket.register_collection() per Guidry's advice
- call sync on: track upload, track delete, track album change, record restore
- mock schedule_album_list_sync in affected tests
fixes the issue where albums created during track upload didn't get
ATProto list records until the user logged in again.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
when renaming an album via PATCH /albums/{album_id}, the slug was not
being updated to match the new title. this caused get_or_create_album()
to fail lookups when adding tracks to renamed albums (since it looks up
by artist_did + slugify(title)), resulting in duplicate albums.
- regenerate slug from new title when title changes
- add regression test for slug sync behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
STATUS.md:
- add PRs #550-554 (pagination, album management, playlist toggle)
- update last modified date
docs/frontend/state-management.md:
- add pagination support to tracks cache section
docs/backend/background-tasks.md:
- add ATProto sync and teal scrobbling to task list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add pagination and infinite scroll to tracks list
backend:
- add cursor-based pagination to /tracks/ endpoint
- use created_at timestamp as cursor for stable pagination
- return next_cursor and has_more fields in response
- default page size of 50, max 100
frontend:
- update TracksCache to support fetchMore() for pagination
- persist pagination state (nextCursor, hasMore) to localStorage
- implement infinite scroll on homepage using IntersectionObserver
- add scroll sentinel element with loading indicator
- trigger fetch 200px before reaching bottom for smooth UX
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: address PR feedback
- move default page size to settings.app.default_page_size
- raise 400 error on invalid cursor format instead of ignoring
- use walrus operator for has_more logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
the show_on_profile toggle was removed when the playlist page was
refactored from modal editing to inline editing (PR #531).
this restores the UI control so users can choose whether their
playlists appear on their public profile. the backend support
was already in place, just the UI was missing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Update album title in UI immediately instead of blocking on backend
response. Toast appears when backend completes, and UI reverts on error.
This makes the edit feel much snappier since the backend call can take
several seconds (updating all track ATProto records + list record).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
When an album title is updated via PATCH /albums/{album_id}, we now also
update the album's ATProto list record with the new name. Previously only
track records were updated, leaving the list record with the stale name.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* fix: album delete endpoint and track ordering from ATProto list
fixes two user-reported issues:
1. album deletion: adds DELETE /albums/{album_id} endpoint
- by default orphans tracks (sets album_id to null)
- with ?cascade=true deletes all tracks in the album
- cleans up ATProto list record and cover image
2. album track ordering: respects ATProto list record order
- get_album now fetches the ATProto list record to determine track order
- falls back to created_at order if no ATProto record exists
- fixes issue where reordering tracks in the frontend didn't persist
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: album edit mode with ATProto sync and portal UX improvements
- add PATCH /albums/{album_id} endpoint for title/description updates
- sync album title changes to all track ATProto records
- add DELETE /albums/{album_id}/tracks/{track_id} to remove tracks from albums
- implement album page edit mode (inline title, cover upload, delete album)
- simplify portal albums section to clickable links (matches playlist UX)
- fix icon buttons to use square shape matching playlist page
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
- created plyr-stats bucket with public dev-url access
- costs data now lives in dedicated bucket, shared across all envs
- removes dependency on environment-specific audio buckets
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: public costs dashboard with daily export to R2
- add /costs page showing monthly infrastructure costs
- costs.json exported daily via GitHub Action to R2
- backend /config endpoint exposes costs_json_url
- ko-fi support link for community funding
- hardcoded Fly/Neon/Cloudflare costs, dynamic AudD from DB
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct audd cost calculation with one-time adjustment
the copyright_scans table was created Nov 24 but first scan recorded
Nov 30, so database counts are incomplete for this billing period.
- hardcode audd values for Nov 24 - Dec 24 from dashboard (6781 requests, $3.91)
- after Dec 24, automatically uses live database counts
- includes cleanup comment to remove hardcoded block after transition
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: update STATUS.md - cost dashboard complete
- add public cost dashboard to recent work section
- remove from immediate priorities (done)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* docs: audit and update documentation
- promote connection-pool-exhaustion runbook from sandbox to docs/runbooks/
- update CLAUDE.md files with current module descriptions
- _internal: add background tasks, moderation, jobs
- api: add albums, playlists, exports, moderation, stats
- docs: add runbooks, testing, moderation, lexicons
- refresh docs/README.md with streamlined navigation
- update STATUS.md:
- add Dec 9 docket/concurrent exports section
- update immediate priorities (moderation cleanup, cost dashboard)
- de-emphasize transcoder (moved to backlog)
- add docket to technical architecture
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: update README with current state
- add docket, logfire to tech stack
- add moderation/transcoder services section
- update local dev to include dev-services (redis)
- add useful commands section with actual justfile targets
- update features (playlists, scrobbling, timed comments, support links)
- add data ownership section
- update project structure (_internal services)
- consolidate links + documentation into single section
- add mirrors section (github, tangled)
- remove stale atproto fork reference
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
terminal dashboard for monitoring AudD copyright scan API usage
and costs. tracks scans per billing period (24th of month), shows
remaining free requests, estimated costs, and daily breakdown with
plotext charts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
previously tracks were downloaded sequentially, making exports slow
for users with many tracks or large files. now downloads happen
concurrently (up to 4 at a time) while zip creation remains sequential
(zipfile isn't thread-safe).
- refactor process_export to use asyncio.gather + semaphore
- add regression test verifying concurrent download behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: migrate ATProto sync and teal scrobbling to docket
- add sync_atproto and scrobble_to_teal as docket background tasks
- remove all fallback/bifurcation code - Redis is always required
- simplify background.py (remove is_docket_enabled)
- update auth.py and playback.py to use new schedulers
- add Redis service to CI workflow
- update tests for simplified docket-only flow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: update test for schedule_atproto_sync, fix cookies deprecation
- test_list_record_sync: patch schedule_atproto_sync instead of removed sync_atproto_records
- test_hidden_tags_filter: move cookies to client constructor to fix httpx deprecation warning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: template database pattern for fast parallel test execution
- use template db + clone for xdist workers (instant file copy vs migrations)
- advisory locks coordinate template creation between workers
- patch settings.database.url per-worker for production code compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ci: enable parallel test execution with xdist
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: ensure test_app fixture depends on db_session for xdist
fixes race condition where tests using test_app without db_session
would run before database URL was patched for the worker
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add testing philosophy and xdist parallel execution guide
- template database pattern for fast parallel tests
- behavior vs implementation testing philosophy
- common pitfalls with fixture dependencies
- guidance on when private function tests are acceptable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: migrate ATProto sync and teal scrobbling to docket
- add sync_atproto and scrobble_to_teal as docket background tasks
- remove all fallback/bifurcation code - Redis is always required
- simplify background.py (remove is_docket_enabled)
- update auth.py and playback.py to use new schedulers
- add Redis service to CI workflow
- update tests for simplified docket-only flow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: update test for schedule_atproto_sync, fix cookies deprecation
- test_list_record_sync: patch schedule_atproto_sync instead of removed sync_atproto_records
- test_hidden_tags_filter: move cookies to client constructor to fix httpx deprecation warning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: template database pattern for fast parallel test execution
- use template db + clone for xdist workers (instant file copy vs migrations)
- advisory locks coordinate template creation between workers
- patch settings.database.url per-worker for production code compatibility
- borrowed pattern from prefecthq/nebula
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ci: enable parallel test execution with xdist
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: ensure test_app fixture depends on db_session for xdist
fixes race condition where tests using test_app without db_session
would run before database URL was patched for the worker
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
- remove text-transform: lowercase from album card titles on artist page
- add theme-aware scrollbar styling to AddToMenu playlist list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
- move export processing from FastAPI BackgroundTasks to docket
- add process_export task function with full R2 upload logic
- add schedule_export helper with asyncio fallback
- register process_export in docket worker
- add tests for scheduling with docket and asyncio fallback
- update background-tasks.md documentation
exports now benefit from docket's durability: if a worker crashes
mid-export, the task will be retried on restart.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* docs: update env docs for docket and suppressed loggers
- fly.toml: update secrets comments with DOCKET_URL, remove stale entries
- fly.staging.toml: add secrets comments (was missing)
- .env.example: add DOCKET_* and LOGFIRE_SUPPRESSED_LOGGERS settings
- configuration.md: document suppressed_loggers setting
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add docket_runs.py script to check task status
standalone uv script to inspect docket runs in redis:
- works with local, staging, or production environments
- no SSH required - connects directly to redis
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add pydocket for background task infrastructure
- add pydocket dependency for Redis-backed background tasks
- add DocketSettings to config (defaults to memory:// for local dev)
- create background.py with docket initialization and worker lifespan
- create background_tasks.py with scan_copyright task
- migrate copyright scan from asyncio.create_task to docket.add()
- add Redis to test docker-compose
- update AGENTS.md with test command note
the copyright scan is the first task migrated to docket. upload processing
still uses FastAPI BackgroundTasks pending auth session refactoring.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: make docket opt-in, add fallback to asyncio.create_task
- change DOCKET_URL default from "memory://plyr" to "" (disabled)
- add is_docket_enabled() check function
- update background_worker_lifespan() to yield None when disabled
- uploads.py: check is_docket_enabled(), fallback to asyncio.create_task
- remove stub process_upload from background_tasks.py
memory mode won't work in production with multiple machines, so docket
must be explicitly enabled with a Redis URL. when disabled, copyright
scans fall back to fire-and-forget asyncio.create_task().
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: clean up upload background processing
- extract featured artist resolution to handles.py
- extract schedule_copyright_scan to unify docket/asyncio branching
- break _process_upload_background into smaller helper functions:
- _save_audio_to_storage
- _save_image_to_storage
- _add_tags_to_track
- _send_track_notification
- fix sketchy json.JSONDecodeError pass with proper logging
- add compose.yaml for local redis
- add just commands: dev-up, dev-down, dev
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: simplify just dev to single command
removes dev-up/dev-down, just use 'just dev' which starts redis,
backend (with DOCKET_URL set), and frontend.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add background tasks and redis documentation
- add docs/backend/background-tasks.md covering docket/redis setup
- update configuration.md with docket settings
- update environments.md with redis instances per environment
- created Upstash Redis instances:
- plyr-redis-prd (production, iad region)
- plyr-redis-stg (staging, iad region)
note: DOCKET_URL not yet wired to fly secrets - will test in dev first
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: use UploadContext dataclass for background processing
- replace 12 function arguments with single UploadContext dataclass
- cleaner interface for _process_upload_background
- update just commands: dev-services / dev-services-down
- update local dev docs to reflect separate terminal workflow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: reorganize atproto module by lexicon namespace
- split monolithic records.py (1000+ lines) into focused modules:
- client.py: PDS request/auth logic, token refresh with per-session locks
- records/fm_plyr/: plyr.fm lexicons (track, like, comment, list, profile)
- records/fm_teal/: teal.fm lexicons (play, status)
- sync.py: high-level sync orchestration
- maintain backward compatibility via re-exports in records/__init__.py
- update test patch paths for new module locations
- add dev-services commands for local redis via docker compose
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* style: make header stats smaller and evenly distributed
- reduce stats font size (0.75rem → 0.65rem) and icons (14px → 12px)
- distribute stats and search evenly across left margin with space-evenly
- margin width responds correctly when queue panel opens
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: resolve docket startup and logging issues
- rename 'name' to 'docket_name' in log extra dict (conflicts with LogRecord.name)
- suppress docket logger noise by setting level to WARNING
- remove unnecessary sleep(0.1) from worker shutdown
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: make suppressed loggers configurable
- add LOGFIRE_SUPPRESSED_LOGGERS setting (defaults to "docket")
- iterate over setting in main.py instead of hardcoding
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add offline mode foundation with auto-download liked tracks
- add storage.ts with Cache API + IndexedDB for offline audio storage
- add GET /audio/{file_id}/url endpoint returning direct R2 URLs for caching
- add auto_download_liked preference (stored in localStorage, device-specific)
- add settings toggle that bulk-downloads all liked tracks when enabled
- auto-download new tracks when liking (if preference enabled)
- Player component checks for cached audio before streaming
- fix TLFM reauth notice to show correct message
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: require auth for audio URL endpoint
adds authentication to GET /audio/{file_id}/url to prevent
unauthenticated enumeration of audio URLs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: improve IndexedDB robustness
- close database connections after each operation (fixes connection leak)
- deduplicate concurrent downloads using in-flight promise map
- verify cache entry exists in isDownloaded() and clean up stale metadata
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: move auto-download toggle to experimental section
keeps the feature available but clearly marked as experimental
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add offline mode foundation with auto-download liked tracks
- add storage.ts with Cache API + IndexedDB for offline audio storage
- add GET /audio/{file_id}/url endpoint returning direct R2 URLs for caching
- add auto_download_liked preference (stored in localStorage, device-specific)
- add settings toggle that bulk-downloads all liked tracks when enabled
- auto-download new tracks when liking (if preference enabled)
- Player component checks for cached audio before streaming
- fix TLFM reauth notice to show correct message
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: require auth for audio URL endpoint
adds authentication to GET /audio/{file_id}/url to prevent
unauthenticated enumeration of audio URLs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: improve IndexedDB robustness
- close database connections after each operation (fixes connection leak)
- deduplicate concurrent downloads using in-flight promise map
- verify cache entry exists in isDownloaded() and clean up stale metadata
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: mobile modal positioning to use full screen
On mobile, modals were getting cut off due to Safari sticky+fixed
positioning issues. Changed from center-based positioning to inset-based
(top/left/right/bottom) to use the full available screen space.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use svelte-portal for modal positioning
the header's backdrop-filter creates a CSS containing block, which
causes position:fixed modals to be positioned relative to the header
instead of the viewport. use svelte-portal to render modals directly
on document.body, preserving proper centering.
- add svelte-portal dependency
- apply use:portal={'body'} to LinksMenu and ProfileMenu modals
- add docs/frontend/portals.md documenting this pattern
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
The layout was rendering default OG tags even for tag pages because
/tag/ wasn't in the hasPageMetadata list, causing crawlers to use
the first (default) tags instead of the page-specific ones.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- add +page.server.ts for SSR tag metadata (name, track count)
- add og:title, og:description, twitter:card meta tags
- keep tracks fetched client-side to preserve auth state
- link previews now show "X tracks tagged #tagname"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Audio update covering Dec 8-17:
- Glass effects and custom background images
- Accurate AudD cost tracking from track duration
- Moderation agent with audit trails
- Performance improvements (removed slow moderation calls)
- iOS Safari fixes, sticky header, album track order preservation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
reverts PR #529. the letta account has been discontinued, so reverting
to the original claude-code-action workflow.
changes:
- restore .github/workflows/status-maintenance.yml to use anthropics/claude-code-action@v1
- delete scripts/status_maintenance.py (letta-backed script)
- delete scripts/letta_status_agent.py (local testing script)
- update STATUS.md to remove letta references
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- calculate API requests from track duration (1 request = 12s audio)
- remove hardcoded Nov 24 fallback - now fully dynamic from DB
- add new fields: requests_this_period, base_cost, overage_cost, billable_requests
- update daily chart to show requests instead of scan count
- change GHA workflow from daily to hourly for near real-time visibility
- update frontend to display request-based metrics with explainer text
AudD billing: $5/mo base + $5/1k requests over 6000 free tier
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- add pointer-events: none to body::before (fixes input blocking)
- remove disabled state from background URL input (can set fallback)
- fix toast message when toggling playing artwork off
- update descriptions to clarify fallback behavior
- always show tile checkbox when background URL is set
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the translateZ transform was causing tracks to overlap each other
in 3D space, blocking click events on like/share buttons for all
tracks below the first one. the queue button worked because it was
positioned differently in the layout.
removed the wheel effect entirely - the visual effect wasn't worth
the broken interactivity.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add glass effects and track item styling
- add CSS variables for glass effects (--glass-bg, --glass-blur, --glass-border)
- apply backdrop-filter blur to Player, Header, and Queue sidebar
- add translucent backgrounds to TrackItem without blur (performance safe)
- add subtle border-radius (6px) and box-shadow to track items
- support both dark and light themes with appropriate glass values
- remove conflicting light theme overrides in favor of CSS variables
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add ui_settings JSONB column for extensible preferences
- add ui_settings JSONB column to user_preferences table
- update preferences API to expose ui_settings field
- merge ui_settings on partial updates to support incremental changes
- add migration for new column
- add tests for ui_settings CRUD and persistence
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add background image settings UI
- add UiSettings interface with background_image_url and background_tile
- add background image URL input and tile toggle in settings page
- apply background image via CSS custom properties in layout
- update preferences manager with updateUiSettings method
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: refine track item hover behavior and glass styling
- remove chunky left border, use uniform subtle border
- add tactile hover: 0.5px lift with accent-tinted glow
- smooth cubic-bezier easing for polished feel
- active state settles back down on click
- adjust track background opacity (88%) for better balance
- fix background image input reactivity bug
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add subtle 3D wheel scroll effect to track items
tracks now appear on a convex cylinder surface:
- items at viewport center are closest
- items above/below rotate away slightly (2° max)
- uses passive scroll listener for performance
- transform-style: preserve-3d for proper layering
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: glass button styling for background image visibility
icon buttons now have translucent backgrounds when a
background image is set, ensuring they remain visible
against any background:
- ShareButton gets glass background
- playlist page icon-btn (edit, delete) gets glass bg
- HiddenTagsFilter eyeball toggle gets glass bg
- glass button CSS variables set dynamically in layout
when background image is present
- respects light/dark theme with appropriate opacity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: consistent glass button styling and preserve bg image on refresh
- unified queue/action buttons across tag, liked, playlist, and album pages
to use glass button CSS variables (--glass-btn-bg, --glass-btn-border)
- only apply background image changes when preferences are actually loaded
to prevent clearing the background image on refresh/hydration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: use playing track artwork as background option
adds a new toggle in settings to use the currently playing
track's artwork as the background image:
- new ui_settings.use_playing_artwork_as_background option
- when enabled, overrides custom background image URL
- background changes dynamically as tracks change
- disables the custom URL input when enabled
- playing artwork never tiles (always cover)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: blur and tile playing artwork background
- playing artwork now tiles in a 4x4 grid (25% size)
- applies 40px blur for smooth, ambient effect
- uses body::before pseudo-element with scale(1.1) to prevent blur edge artifacts
- custom background images remain unblurred
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: fall back to custom bg when playing track has no artwork
when "use playing artwork as background" is enabled but the
current track has no artwork, now falls back to the custom
background URL if one is set (instead of showing nothing)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add subtle text glow for readability against backgrounds
adds a --text-shadow CSS variable that provides a soft glow effect
around gray metadata text when a background image is set. this improves
readability without being visually heavy like a drop shadow.
applied to:
- album page metadata (type, title, meta, artist link)
- tag page track count subtitle
- settings page section headers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use proper fallbacks for glass button styling
when no background image is set, buttons should fall back to
transparent backgrounds and standard border colors rather than
hardcoded dark theme glass values.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
STATUS.md:
- added missing section for Dec 10-12 work (PRs #558-572)
- documents background task expansion (like/comment PDS writes, album sync)
- documents Redis cache for copyright labels (PR #566)
- documents mobile UX improvements and misc fixes
background-tasks.md:
- added new tasks: album list sync, PDS like/unlike, PDS comment CRUD
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: make header sticky on scroll
- change overflow-x from hidden to clip on .app-layout to preserve
position: sticky on descendants
- add position: sticky and background to header so it sticks to top
when scrolling through long lists
previously, scrolling down a long track list required scrolling all the
way back up to access search or navigation. now the header stays visible.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: update STATUS.md with Dec 14-15 work
- performance improvements (PRs #590-591)
- moderation agent (PRs #586, #588)
- bug fixes (PRs #589, #592, #593)
- iOS Safari fixes (PRs #573-576)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: preserve album track order during ATProto sync (#587)
when syncing album list records to ATProto, the background sync was
always ordering tracks by created_at, overwriting any custom order
the user had set via the frontend reorder feature.
now the sync:
1. fetches the existing ATProto list record order (if any)
2. preserves that order for existing tracks
3. appends any new tracks at the end (sorted by created_at)
this prevents user-reordered albums from reverting on login.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use unique DID and cleanup in test to avoid CI conflicts
the test was sharing fixtures with fixed DIDs causing foreign key
constraint violations during teardown when running in parallel with xdist.
now uses:
- unique DID with uuid suffix for test isolation
- explicit cleanup in finally block (tracks → albums → artists order)
- properly typed capture function for lint compliance
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
same issue as /tracks/ - copyright info is only displayed in artist
portal, not public tag browse pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the copyright check was making an HTTP call to moderation.plyr.fm on
every /tracks/ request, adding ~1 second latency. this info is only
displayed in /tracks/me (artist portal), not the main feed.
- remove get_copyright_info from main listing endpoint
- keep it in /tracks/me and /tracks/me/broken where it's needed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the playlist endpoint wasn't checking for authenticated users, so
tracks always showed is_liked: false even when the user had liked them.
backend:
- add session cookie check to GET /lists/playlists/{id}
- query user's liked tracks when authenticated
- pass liked_track_ids to TrackResponse.from_track()
frontend:
- add client-side liked state hydration (matching artist page pattern)
- prime from localStorage cache, then fetch fresh data
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- update prompt to de-emphasize unreliable match scores
- focus analysis on title/artist name matching instead
- remove 200 char truncation on reasoning notes
- make resolution notes use full card width in admin UI
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- add AI-powered moderation agent (scripts/moderation_agent.py) that:
- fetches pending copyright flags from moderation service
- uses Claude to categorize as violation/false positive/needs review
- shows reasoning for each decision in scannable table format
- bulk resolves false positives with human approval
- fix JSON API endpoint to store resolution reason and notes
(previously only the htmx endpoint saved this data)
- update admin UI to display resolution notes prominently
for resolved items instead of hiding in tooltip
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
documents the confidential OAuth client implementation:
- PR #578: initial confidential client support
- PRs #580-582: bug fixes for aud claim and kid header
- fork updates for issuer and kid parameters
- outcome: 180-day refresh tokens, remember-me working
- links to #583 for future account switching work
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
the ATProto OAuth spec requires client assertions to include the kid
in the JWT header so the PDS knows which public key to use for
verification.
changes:
- rename _load_client_secret_key() to _load_client_secret()
- return tuple of (key, kid) instead of just key
- validate that OAUTH_JWK includes kid field
- pass client_secret_kid to OAuthClient
- update atproto fork to v0.0.1.dev470 with kid support
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
python-jose's to_dict() doesn't include the kid field from the
original JWK. this fix explicitly copies the kid from the input
JWK to the public key output.
the kid is required by ATProto OAuth for key identification when
validating client assertions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- update atproto fork to include aud claim fix (dfbaf00)
- client assertion JWT now uses issuer (not token endpoint) as aud claim
- this fixes "unexpected aud claim value" errors with confidential clients
- fix tests to explicitly mock OAUTH_JWK setting
- tests were relying on env not having OAUTH_JWK set, but dev env has it
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add confidential OAuth client support for longer-lived sessions
adds support for ATProto OAuth confidential clients using private_key_jwt
authentication. when OAUTH_JWK is configured, the client authenticates
with a cryptographic key, earning 180-day refresh tokens (vs 2-week for
public clients).
changes:
- add OAUTH_JWK setting to AtprotoSettings for ES256 private key
- update OAuthClient to pass client_secret_key when configured
- add /.well-known/jwks.json endpoint for public key discovery
- update /oauth-client-metadata.json to include confidential client fields
- add scripts/gen_oauth_jwk.py utility to generate keys
- add tests for is_confidential_client() and get_public_jwks()
to enable:
1. run: uv run python scripts/gen_oauth_jwk.py
2. add output to .env as OAUTH_JWK='...'
closes #577
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* address review comments: remove deferred imports, add type annotations
- move imports to top level in main.py (is_confidential_client, get_public_jwks, HTTPException)
- add type annotation to metadata variable: dict[str, Any]
- update return types to dict[str, Any]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add OAuth confidential client documentation
explains what confidential clients are, why they matter for plyr.fm,
and how the implementation works. includes sources and key rotation
guidance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add token refresh mechanism and migration notes
- explain how token refresh works (trigger, detection, refresh, retry)
- document what gets refreshed (access vs refresh tokens)
- add observability notes (logfire log messages)
- document migration impact for existing sessions
- clarify that existing tokens can't be upgraded (2-week refresh limit)
- note that only 3 internal dev tokens affected in production
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* debug: add console logs to AddToMenu for iOS Safari debugging
Logs:
- toggleMenu called with menuOpen state and viewport size
- dropdown element presence check
- computed styles (position, z-index, display, visibility, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: override open-upward class in mobile media query
The .open-upward class was setting top: auto and bottom: calc(100% + 4px)
which wasn't being overridden by the mobile media query's .menu-dropdown
styles, causing the dropdown to render at top: -218px (off-screen).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
without an explicit id, iOS may conflate different PWAs when routing
media session events. this caused tapping track metadata in control
center to open the wrong home screen app (leaflet.pub instead of plyr.fm).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- AddToMenu now includes queue and share actions (matching TrackActionsMenu)
- Both menus open from top on mobile instead of bottom (doesn't cover player)
- Added backdrop for proper dismissal on mobile
- Track detail page passes shareUrl and onQueue props to AddToMenu
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add redis cache for copyright label lookups
the moderation service call was causing 2-3s latency spikes on GET /tracks/
in production. since we have multiple fly.io instances, in-memory caching
wouldn't work - added distributed redis cache (reusing docket's redis).
- add backend/utilities/redis.py for async client from docket URL
- cache active label status with 5min TTL (matches queue cache)
- use mget/pipeline for efficient batch operations
- invalidate cache when labels are emitted
- fail closed on errors (treat as active)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: move cache settings to config, add async context manager
- add label_cache_prefix and label_cache_ttl_seconds to ModerationSettings
- add async_redis_client() context manager for isolated connections
- add clear_client_cache() for test cleanup
- remove hardcoded cache constants from moderation.py
- fix tests to properly clear client cache between runs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* test: add redis isolation for xdist parallel tests
- add redis_database fixture that assigns different DB per worker
- use unique URIs in cache tests to avoid cross-test pollution
- document redis test isolation pattern in docs/testing/README.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: handle missing redis gracefully in test fixture
the redis_database fixture now catches ConnectionError and skips
silently when redis is unavailable. tests that don't need redis
will pass, and tests that do need it will fail with specific errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: mock settings in moderation cache tests
tests that mock httpx must also mock settings.moderation to avoid
early return on auth_token check. without this, tests pass locally
(where MODERATION_AUTH_TOKEN may be set) but fail in CI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use D: prefix for DOCKET_URL to allow CI override
pytest-env's D: prefix means "default" - only set if not already
set by the environment. this allows CI's DOCKET_URL=redis://localhost:6379
to take precedence over pyproject.toml's 6380 (for local docker-compose).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: move deferred imports to top of file, add type hints
- move redis imports to module level in moderation.py
- move asyncio import to module level in redis.py
- add type hint for kwargs dict in redis.py
- move imports to module level in conftest.py
- add rule to AGENTS.md: DO NOT UNNECESSARILY DEFER IMPORTS
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add atprotofans support link mode
adds three support link modes for artist profiles:
- none: no support link displayed
- atprotofans: links to atprotofans.com/profile/{handle}
- custom: user-provided https:// URL (existing behavior)
backend:
- validate support_url accepts 'atprotofans' magic value
- reject non-https URLs for custom links
- add tests for all three modes
frontend:
- portal page: radio button selector for support link mode
- artist profile: compute actual URL from mode + handle
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: validate atprotofans eligibility before selection
checks user's PDS for com.atprotofans.profile/self record with
acceptingSupporters=true before allowing atprotofans selection.
- client-side check on portal load (no backend sprawl)
- shows "set up" link when not eligible
- shows "ready" when eligible
- disables option when ineligible
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: use ATProto SDK for proper handle/PDS resolution
- add @atproto/api SDK to frontend for proper ATProto operations
- fix portal atprotofans eligibility check to resolve DID to PDS first
- fix backend handles.py to use AsyncIdResolver instead of bsky.social
- fix frontend error.svelte to use SDK for handle resolution
the issue was hardcoded bsky.social URLs which don't work for users
on self-hosted PDS instances. now we properly resolve DIDs via
plc.directory and query the user's actual PDS.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: show 'profile ready' as link to atprotofans profile
when eligible, the status now shows "profile ready" as a clickable
link to the user's actual atprotofans profile page.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct atprotofans URL to use /u/{did} not /profile/{handle}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: move like and comment PDS writes to background tasks
Likes:
- Update like/unlike endpoints to use optimistic DB writes
- Schedule PDS record operations via docket background tasks
- Make atproto_like_uri nullable to support async PDS writes
- Update tests to verify background task scheduling
Comments:
- Update create/update/delete comment endpoints to use optimistic DB writes
- Schedule PDS record operations via docket background tasks
- Make atproto_comment_uri nullable to support async PDS writes
- Update tests to verify background task scheduling
This reduces API response times by moving slow PDS writes to the background
while keeping the UI responsive with immediate local database updates.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: move deferred imports to module level
Move imports that were unnecessarily deferred inside PDS task functions
to the top of the module for clarity.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
the default docket worker polls redis every 250ms (4x/sec), which
caused ~3.4M redis commands in 2 days and $6.73 in upstash costs.
changes:
- add check_interval_seconds and scheduling_resolution_seconds to DocketSettings
- default both to 5 seconds (20x reduction in polling frequency)
- update background.py Worker to use these settings
- update audd costs in export_costs.py ($3.91 -> $9.13 for current period)
expected redis cost reduction: ~95% for idle polling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
adds sync_album_list task to sync album ATProto list records immediately
after track operations, rather than waiting for the user's next login.
changes:
- add sync_album_list task and schedule_album_list_sync to background_tasks.py
- refactor _register_tasks to use docket.register_collection() per Guidry's advice
- call sync on: track upload, track delete, track album change, record restore
- mock schedule_album_list_sync in affected tests
fixes the issue where albums created during track upload didn't get
ATProto list records until the user logged in again.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
when renaming an album via PATCH /albums/{album_id}, the slug was not
being updated to match the new title. this caused get_or_create_album()
to fail lookups when adding tracks to renamed albums (since it looks up
by artist_did + slugify(title)), resulting in duplicate albums.
- regenerate slug from new title when title changes
- add regression test for slug sync behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
STATUS.md:
- add PRs #550-554 (pagination, album management, playlist toggle)
- update last modified date
docs/frontend/state-management.md:
- add pagination support to tracks cache section
docs/backend/background-tasks.md:
- add ATProto sync and teal scrobbling to task list
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add pagination and infinite scroll to tracks list
backend:
- add cursor-based pagination to /tracks/ endpoint
- use created_at timestamp as cursor for stable pagination
- return next_cursor and has_more fields in response
- default page size of 50, max 100
frontend:
- update TracksCache to support fetchMore() for pagination
- persist pagination state (nextCursor, hasMore) to localStorage
- implement infinite scroll on homepage using IntersectionObserver
- add scroll sentinel element with loading indicator
- trigger fetch 200px before reaching bottom for smooth UX
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: address PR feedback
- move default page size to settings.app.default_page_size
- raise 400 error on invalid cursor format instead of ignoring
- use walrus operator for has_more logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
the show_on_profile toggle was removed when the playlist page was
refactored from modal editing to inline editing (PR #531).
this restores the UI control so users can choose whether their
playlists appear on their public profile. the backend support
was already in place, just the UI was missing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Update album title in UI immediately instead of blocking on backend
response. Toast appears when backend completes, and UI reverts on error.
This makes the edit feel much snappier since the backend call can take
several seconds (updating all track ATProto records + list record).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
When an album title is updated via PATCH /albums/{album_id}, we now also
update the album's ATProto list record with the new name. Previously only
track records were updated, leaving the list record with the stale name.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* fix: album delete endpoint and track ordering from ATProto list
fixes two user-reported issues:
1. album deletion: adds DELETE /albums/{album_id} endpoint
- by default orphans tracks (sets album_id to null)
- with ?cascade=true deletes all tracks in the album
- cleans up ATProto list record and cover image
2. album track ordering: respects ATProto list record order
- get_album now fetches the ATProto list record to determine track order
- falls back to created_at order if no ATProto record exists
- fixes issue where reordering tracks in the frontend didn't persist
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: album edit mode with ATProto sync and portal UX improvements
- add PATCH /albums/{album_id} endpoint for title/description updates
- sync album title changes to all track ATProto records
- add DELETE /albums/{album_id}/tracks/{track_id} to remove tracks from albums
- implement album page edit mode (inline title, cover upload, delete album)
- simplify portal albums section to clickable links (matches playlist UX)
- fix icon buttons to use square shape matching playlist page
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
- created plyr-stats bucket with public dev-url access
- costs data now lives in dedicated bucket, shared across all envs
- removes dependency on environment-specific audio buckets
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: public costs dashboard with daily export to R2
- add /costs page showing monthly infrastructure costs
- costs.json exported daily via GitHub Action to R2
- backend /config endpoint exposes costs_json_url
- ko-fi support link for community funding
- hardcoded Fly/Neon/Cloudflare costs, dynamic AudD from DB
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: correct audd cost calculation with one-time adjustment
the copyright_scans table was created Nov 24 but first scan recorded
Nov 30, so database counts are incomplete for this billing period.
- hardcode audd values for Nov 24 - Dec 24 from dashboard (6781 requests, $3.91)
- after Dec 24, automatically uses live database counts
- includes cleanup comment to remove hardcoded block after transition
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: update STATUS.md - cost dashboard complete
- add public cost dashboard to recent work section
- remove from immediate priorities (done)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* docs: audit and update documentation
- promote connection-pool-exhaustion runbook from sandbox to docs/runbooks/
- update CLAUDE.md files with current module descriptions
- _internal: add background tasks, moderation, jobs
- api: add albums, playlists, exports, moderation, stats
- docs: add runbooks, testing, moderation, lexicons
- refresh docs/README.md with streamlined navigation
- update STATUS.md:
- add Dec 9 docket/concurrent exports section
- update immediate priorities (moderation cleanup, cost dashboard)
- de-emphasize transcoder (moved to backlog)
- add docket to technical architecture
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: update README with current state
- add docket, logfire to tech stack
- add moderation/transcoder services section
- update local dev to include dev-services (redis)
- add useful commands section with actual justfile targets
- update features (playlists, scrobbling, timed comments, support links)
- add data ownership section
- update project structure (_internal services)
- consolidate links + documentation into single section
- add mirrors section (github, tangled)
- remove stale atproto fork reference
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
terminal dashboard for monitoring AudD copyright scan API usage
and costs. tracks scans per billing period (24th of month), shows
remaining free requests, estimated costs, and daily breakdown with
plotext charts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
previously tracks were downloaded sequentially, making exports slow
for users with many tracks or large files. now downloads happen
concurrently (up to 4 at a time) while zip creation remains sequential
(zipfile isn't thread-safe).
- refactor process_export to use asyncio.gather + semaphore
- add regression test verifying concurrent download behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* feat: migrate ATProto sync and teal scrobbling to docket
- add sync_atproto and scrobble_to_teal as docket background tasks
- remove all fallback/bifurcation code - Redis is always required
- simplify background.py (remove is_docket_enabled)
- update auth.py and playback.py to use new schedulers
- add Redis service to CI workflow
- update tests for simplified docket-only flow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: update test for schedule_atproto_sync, fix cookies deprecation
- test_list_record_sync: patch schedule_atproto_sync instead of removed sync_atproto_records
- test_hidden_tags_filter: move cookies to client constructor to fix httpx deprecation warning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: template database pattern for fast parallel test execution
- use template db + clone for xdist workers (instant file copy vs migrations)
- advisory locks coordinate template creation between workers
- patch settings.database.url per-worker for production code compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ci: enable parallel test execution with xdist
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: ensure test_app fixture depends on db_session for xdist
fixes race condition where tests using test_app without db_session
would run before database URL was patched for the worker
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add testing philosophy and xdist parallel execution guide
- template database pattern for fast parallel tests
- behavior vs implementation testing philosophy
- common pitfalls with fixture dependencies
- guidance on when private function tests are acceptable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: migrate ATProto sync and teal scrobbling to docket
- add sync_atproto and scrobble_to_teal as docket background tasks
- remove all fallback/bifurcation code - Redis is always required
- simplify background.py (remove is_docket_enabled)
- update auth.py and playback.py to use new schedulers
- add Redis service to CI workflow
- update tests for simplified docket-only flow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: update test for schedule_atproto_sync, fix cookies deprecation
- test_list_record_sync: patch schedule_atproto_sync instead of removed sync_atproto_records
- test_hidden_tags_filter: move cookies to client constructor to fix httpx deprecation warning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: template database pattern for fast parallel test execution
- use template db + clone for xdist workers (instant file copy vs migrations)
- advisory locks coordinate template creation between workers
- patch settings.database.url per-worker for production code compatibility
- borrowed pattern from prefecthq/nebula
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* ci: enable parallel test execution with xdist
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: ensure test_app fixture depends on db_session for xdist
fixes race condition where tests using test_app without db_session
would run before database URL was patched for the worker
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
- move export processing from FastAPI BackgroundTasks to docket
- add process_export task function with full R2 upload logic
- add schedule_export helper with asyncio fallback
- register process_export in docket worker
- add tests for scheduling with docket and asyncio fallback
- update background-tasks.md documentation
exports now benefit from docket's durability: if a worker crashes
mid-export, the task will be retried on restart.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* docs: update env docs for docket and suppressed loggers
- fly.toml: update secrets comments with DOCKET_URL, remove stale entries
- fly.staging.toml: add secrets comments (was missing)
- .env.example: add DOCKET_* and LOGFIRE_SUPPRESSED_LOGGERS settings
- configuration.md: document suppressed_loggers setting
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add docket_runs.py script to check task status
standalone uv script to inspect docket runs in redis:
- works with local, staging, or production environments
- no SSH required - connects directly to redis
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add pydocket for background task infrastructure
- add pydocket dependency for Redis-backed background tasks
- add DocketSettings to config (defaults to memory:// for local dev)
- create background.py with docket initialization and worker lifespan
- create background_tasks.py with scan_copyright task
- migrate copyright scan from asyncio.create_task to docket.add()
- add Redis to test docker-compose
- update AGENTS.md with test command note
the copyright scan is the first task migrated to docket. upload processing
still uses FastAPI BackgroundTasks pending auth session refactoring.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: make docket opt-in, add fallback to asyncio.create_task
- change DOCKET_URL default from "memory://plyr" to "" (disabled)
- add is_docket_enabled() check function
- update background_worker_lifespan() to yield None when disabled
- uploads.py: check is_docket_enabled(), fallback to asyncio.create_task
- remove stub process_upload from background_tasks.py
memory mode won't work in production with multiple machines, so docket
must be explicitly enabled with a Redis URL. when disabled, copyright
scans fall back to fire-and-forget asyncio.create_task().
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: clean up upload background processing
- extract featured artist resolution to handles.py
- extract schedule_copyright_scan to unify docket/asyncio branching
- break _process_upload_background into smaller helper functions:
- _save_audio_to_storage
- _save_image_to_storage
- _add_tags_to_track
- _send_track_notification
- fix sketchy json.JSONDecodeError pass with proper logging
- add compose.yaml for local redis
- add just commands: dev-up, dev-down, dev
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: simplify just dev to single command
removes dev-up/dev-down, just use 'just dev' which starts redis,
backend (with DOCKET_URL set), and frontend.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: add background tasks and redis documentation
- add docs/backend/background-tasks.md covering docket/redis setup
- update configuration.md with docket settings
- update environments.md with redis instances per environment
- created Upstash Redis instances:
- plyr-redis-prd (production, iad region)
- plyr-redis-stg (staging, iad region)
note: DOCKET_URL not yet wired to fly secrets - will test in dev first
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: use UploadContext dataclass for background processing
- replace 12 function arguments with single UploadContext dataclass
- cleaner interface for _process_upload_background
- update just commands: dev-services / dev-services-down
- update local dev docs to reflect separate terminal workflow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: reorganize atproto module by lexicon namespace
- split monolithic records.py (1000+ lines) into focused modules:
- client.py: PDS request/auth logic, token refresh with per-session locks
- records/fm_plyr/: plyr.fm lexicons (track, like, comment, list, profile)
- records/fm_teal/: teal.fm lexicons (play, status)
- sync.py: high-level sync orchestration
- maintain backward compatibility via re-exports in records/__init__.py
- update test patch paths for new module locations
- add dev-services commands for local redis via docker compose
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* style: make header stats smaller and evenly distributed
- reduce stats font size (0.75rem → 0.65rem) and icons (14px → 12px)
- distribute stats and search evenly across left margin with space-evenly
- margin width responds correctly when queue panel opens
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: resolve docket startup and logging issues
- rename 'name' to 'docket_name' in log extra dict (conflicts with LogRecord.name)
- suppress docket logger noise by setting level to WARNING
- remove unnecessary sleep(0.1) from worker shutdown
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: make suppressed loggers configurable
- add LOGFIRE_SUPPRESSED_LOGGERS setting (defaults to "docket")
- iterate over setting in main.py instead of hardcoding
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>