Commit Graph

16 Commits

Author SHA1 Message Date
Brian Fertig bb6a1a962e chore: simplify playlist visibility logic and update dependencies
- Remove `VISIBILITY_RANK` and auto-upgrade logic from admin routes
- Simplify `playlists.js` by removing `getEffectiveVisibility` and complex `NOT EXISTS` subqueries in list queries
- Update `public.js` to use direct playlist visibility instead of effective visibility
- Bump `better-sqlite3` to v11.10.0 and set project version to 1.0.0
2026-05-02 16:38:09 -06:00
Brian Fertig cb2ff2492f feat: add playlist top genres and similar playlists
- Add `top_genres` column to playlists table to store the top 3 genres
- Implement `computeTopGenres`, `updateTopGenres`, and `reindexAllGenres` in playlists service
- Add "Similar Playlists" section to public playlist view based on genre overlap
- Display genre tags on playlist details page
- Add admin panel route to re-index all playlist genres
- Update social tooltip positioning to use fixed positioning for better visibility
- Add CSS styles for genre tags and track numbers
- Increment service worker cache version
2026-04-19 12:10:39 -06:00
Brian Fertig 024c3a5e40 feat: add NSFW flag and visibility controls for explicit content
- Add `is_nsfw` column to `songs` and `playlists` tables
- Implement NSFW checkbox in song/playlist upload and edit forms
- Enforce NSFW content visibility: block unauthenticated users from viewing/streaming NSFW songs/playlists
- Filter NSFW content from public-facing lists (recent, popular, liked, etc.) unless user is logged in
- Add VIP-only visibility option for songs/playlists (admin/VIP users only)
- Display "EXPLICIT" badge on NSFW items in UI
- Add CSS styling for NSFW badge
- Update service layer to handle NSFW flag in CRUD operations and queries
2026-04-16 19:55:26 -06:00
Brian Fertig 3586e1da9a feat: add song selection toolbar and popular songs section
- Enable bulk song selection with custom checkboxes and select-all header row
- Add "Most Popular" section (scored by likes + 2×favorites) alongside Trending
- Improve horizontal scrolling for liked strips with grab/grabbing cursor and drag-to-scroll logic
- Introduce neon divider (`hr.hr-neon`) for visual separation between sections
- Update CSS grid layout for selectable song lists to accommodate checkboxes
2026-04-14 20:12:45 -06:00
Brian Fertig 771165f042 Add VIP visibility tier for songs and playlists
- Introduce `vip` visibility level with CSS badge styling
- Update admin routes to restrict VIP setting to admins and VIP users
- Extend visibility logic in public routes (`canView`, `denyAccess`)
- Add VIP-specific SQL queries in playlists, social, and songs services
- Update EJS templates to show VIP badges and radio options for authorized users
2026-04-14 19:12:02 -06:00
Brian Fertig 5828b9c9f1 feat: Add faceted search & trending strip to songs page + mobile nav toggle
- Add genre and uploader filters to /songs with persistent query params in pagination
- Implement site-wide "Trending" strip showing recently liked songs
- Introduce responsive hamburger nav for mobile with animated icon & ARIA support
- Refactor song row layout: move duration into separate `.song-duration` element
- Update CSS for mobile grid (2 columns), optimized song rows, and facet selects
2026-04-13 23:12:33 -06:00
Brian Fertig c71538b45d feat: add song playlist appearances section and edit buttons for creators
- Introduce a new "Appears in" section on song pages showing playlists containing the song (public/logged_in visibility)
- Add secondary button styling for Edit links on song and playlist detail pages, visible only to creators
- Implement `getPlaylistsForSong()` service function with guest/user-aware queries
- Update view templates to render edit buttons and playlist appearance cards
2026-04-13 21:08:22 -06:00
Brian Fertig 347cf97da7 feat: add Open Graph and Twitter Card meta tags for public pages
- Introduce appBaseUrl config option for absolute URLs in social cards
- Generate og metadata for song and playlist pages with title, description, image, and URL
- Include partial layout support for rendering OG/Twitter meta tags conditionally
2026-04-12 10:43:19 -06:00
Brian Fertig 25d68e1dcb feat: add user profiles with slugs and enhance now-playing UI
- Add database migration to create unique `slug` column for users table
- Implement profile routes (`/profiles`, `/profiles/:slug`) with views for:
  • listing verified user profiles with avatars, song/playlist counts
  • individual profile pages showing user's songs, playlists, liked items
- Add helper functions in `users.js`, `songs.js`, `playlists.js`, and `social.js`
  to support public visibility filtering and profile data enrichment
- Enhance now-playing overlay UI with:
  • vinyl sleeve animation (sleeve + record peeking behind cover)
  • clickable creator info to open profile page if slug exists
  • track row click to jump directly to a song in the queue
- Update CSS for profiles grid, detail creator links, and overlay styling
- Add "Profiles" link to header navigation

This enables a full user profile system with vanity URLs and improves the
music player experience with visual polish and direct navigation.
2026-04-11 13:46:12 -06:00
Brian Fertig be5857fe3b feat: add user avatars with cropping and image lightbox
- Add `avatar_path` column to users table via migration 008
- Integrate `cropperjs` and `sharp` for avatar upload, cropping (600×600), and PNG conversion
- Serve avatars at `/media/avatars` with static caching; expose `/static/vendor/cropperjs`
- Add avatar management UI in account settings with modal cropping workflow
- Display creator avatars on song/playlist detail pages (fallback to initial)
- Implement generic image lightbox (`lightbox.js`) for cover art with zoom animations and keyboard support
- Refactor song/playlist detail views to use responsive layout and lightbox-enabled covers
2026-04-11 10:08:05 -06:00
Brian Fertig f044d98afc feat: implement social actions (like/favorite) for songs and playlists
- Add database tables for song/playlist likes and favorites
- Create `social` service with toggle functions and enrichment helpers
- Implement `/api/:type/:id/(like|favorite)` routes with CSRF protection
- Add like/favorite buttons to player, song lists, playlists, and cards
- Support guest → login redirect via `data-require-login`
- Inject CSRF token into layout for JS API requests
2026-04-11 09:12:21 -06:00
Brian Fertig a24f2fe75d feat: add configurable site name via SITE_NAME env var
- Introduce `SITE_NAME` environment variable with fallback to 'Bri-Tunes'
- Propagate `siteName` to templates via `res.locals`
- Replace hardcoded 'Bri-Tunes' references in layout, header, home title, and boot sequence
- Update `.env.example` with new variable
2026-04-11 08:34:11 -06:00
Brian Fertig 5394e0cef4 feat: replace ID-based URLs with slugs for songs and playlists
- Add `slug` column to `songs` and `playlists` tables via migrations 005 & 006
- Implement slug generation logic (lowercase, hyphenated, unique) in both services
- Backfill existing rows with auto-generated slugs on startup
- Update public routes to use `/songs/:slug` and `/playlists/:slug`
- Replace all view templates to link using slugs instead of numeric IDs
2026-04-11 08:14:27 -06:00
Brian Fertig 9438330f22 feat: add playlist creation credit display, shuffle playback, drag-and-drop reordering, and email verification flow improvements
- Display playlist creator name on public and admin playlist views
- Add shuffle playback button for playlists in player UI
- Implement drag-and-drop reordering for playlist tracks with visual feedback
- Improve email verification UX: redirect pending users to verify page with resend option
- Simplify admin routes by removing redundant role checks (user-based filtering already handled)
- Adjust featured playlist count and add "show all" links on home page
2026-04-10 20:14:54 -06:00
Brian Fertig b4af77066a feat: implement three-tier visibility system for songs and playlists
- Add public/logged_in/private visibility levels to songs and playlists via database migration (002_visibility.sql)
- Replace old `is_public` boolean with new `visibility` enum in admin forms, API schemas, and services
- Implement access control logic:
  - Guests see only public items that don't contain restricted tracks
  - Logged-in users see public + logged_in items (excluding private ones)
  - Admins see all; regular users manage their own content
- Auto-upgrade playlist visibility when adding more restrictive songs
- Add UI badges for visibility levels and update admin views to reflect new hierarchy

PWA enhancements:
- Update web manifest with proper name, colors, and icon paths
- Add service worker (sw.js) with cache-first for static assets and network-first for HTML
- Register SW at root (/sw.js) with Service-Worker-Allowed header for full origin scope
- Add theme-color meta tag and navigate.js for client-side routing

Other:
- Update admin nav label from "Admin" to "My Music" to reflect role-based access
2026-04-09 22:40:18 -06:00
Brian Fertig a515df90de first commit 2026-04-09 18:41:01 -06:00