Skip to content

feat: add genre-based song browsing endpoint (Closes #78) - #228

Merged
Akatenvictor merged 2 commits into
AudioBitsStellar:mainfrom
achiever2110:feat/issue-78-genre-browsing
Aug 26, 2026
Merged

feat: add genre-based song browsing endpoint (Closes #78)#228
Akatenvictor merged 2 commits into
AudioBitsStellar:mainfrom
achiever2110:feat/issue-78-genre-browsing

Conversation

@achiever2110

Copy link
Copy Markdown
Contributor

Summary

Adds genre-based browsing so users can discover songs by genre, with pagination and sorting.

Closes #78

Changes

  • Genre entity linked to Song via a new genreId foreign key (migration 1753200000005-AddSongGenreRelation)
  • GET /api/genres — all genres with live song counts
  • GET /api/genres/:id/songs — songs in a genre, paginated
    • Sort by newest (default), most_played, or alphabetical
    • Pagination via page / limit (default 20, max 100)
    • Response includes total for client-side pagination
  • SongService.getSongsByGenre filters ready, unflagged songs with artist metadata

Tests

  • GenreService unit tests (song counts)
  • SongService.getSongsByGenre unit tests (pagination, sorting, clamping)
  • GenreController tests (mocked services)
  • All 13 passing

Acceptance Criteria

  • GET /api/genres returns all available genres with song counts
  • GET /api/genres/:id/songs returns songs in that genre with pagination
  • Supports sort by: newest, most played, alphabetical
  • Pagination via query params: page, limit (default 20, max 100)
  • Response includes total count for client-side pagination
  • Genre entity properly linked to Song entity via foreign key

)

Add genre discovery and browsing: songs gain a genreId foreign key to
the Genre entity, GET /api/genres returns every genre with live song
counts, and GET /api/genres/:id/songs returns ready, unflagged songs in
a genre with pagination and sorting (newest, most played, alphabetical).
Includes migration, controller, routes, and unit tests.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@achiever2110 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Akatenvictor
Akatenvictor merged commit 2a111e1 into AudioBitsStellar:main Aug 26, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add genre-based song browsing endpoint

2 participants