Skip to content

Conversation

tomast1337
Copy link
Member

No description provided.

…ponding tests

- Added getFeaturedSongs method to SongService to retrieve featured songs across various timespans.
- Implemented tests for getFeaturedSongs to ensure correct functionality and handling of empty results.
- Removed SongBrowser module and related files as part of the refactor to streamline the service structure.
- Introduced new PageDto class for pagination handling in the database module.
- Implemented various query modes in getSongList method to support fetching featured, recent, category-based, and random songs.
- Added error handling for invalid query parameters and improved response types using PageDto.
- Introduced searchSongs method for keyword-based song searches with pagination.
- Updated Swagger documentation to reflect new query parameters and response structures.
@tomast1337 tomast1337 changed the base branch from main to develop October 5, 2025 17:49
@Bentroen Bentroen mentioned this pull request Oct 5, 2025
25 tasks
@Bentroen Bentroen changed the title Feature/song search feat: song search Oct 6, 2025
Bentroen and others added 4 commits October 6, 2025 00:47
- Introduced  for improved query handling, allowing filtering by title, category, uploader, and sorting by various criteria.
- Updated  method in  to support new query parameters and sorting logic.
- Added new endpoints for fetching featured songs and available categories.
- Refactored frontend components to align with updated API endpoints and enhance song search functionality.
- Improved error handling and loading states in the frontend for better user experience.
- Introduced a new SearchButton component for searching songs.
- Integrated the SearchButton into the Header component for improved accessibility.
- Implemented search query handling and routing to the search results page.
Copy link
Member

@Bentroen Bentroen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! I'm so excited to ship this feature 🤩

I've left a few considerations in the review comments; not all of them may be actionable atm.

A few points we've yet to work on:

  • I'll work on touching up the frontend presentation so it's more consistent with our current design.
  • Recent songs seem not to be loading locally for me
  • Are the tests still supposed to be failing?

query.page,
query.limit,
);
return new PageDto<SongPreviewDto>({
Copy link
Member

@Bentroen Bentroen Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this part of the code be extracted outside of the if clause? It's repeated exactly for each query mode :)

EDIT: I mean the return new PageDto({...}) part. For some reason I highlighted completely wrong lines.

try {
const response = await axiosInstance.get<FeaturedSongsDto>(
'/song-browser/featured',
'/song/featured',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this route supposed to clash with the GET /song/:id endpoint? Is this currently the case, or is there some precedence order going on to prevent this from happening?

Our song IDs are 10 characters long, spanning A-Za-z0-9, but were they 8 characters long, featured could technically be a valid song ID.

try {
const response = await axiosInstance.get<Record<string, number>>(
'/song-browser/categories',
'/song/categories',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oop, there we go - categories, a perfectly valid song id! xD

Though I believe the chance of this happening is quite unlikely... 1 in 62^10 or something?

@Bentroen
Copy link
Member

Bentroen commented Oct 7, 2025

Pictures of the current frontend (courtesy of @tomast1337!):

image image

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.

2 participants