-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#227: Add Calculated field/property for artist total streams #241
#227: Add Calculated field/property for artist total streams #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, everything looks good :). Take a look at the minor change I proposed. I have to adapt frontend side of this task, would you mind if I update your existing PR with that code I'm going to implement?
It's fine, of course if it helps keep things better organized and adding frontend functionality won't take long, I'm fine with that. I like when PRs are completed and merged, at least from my side. @AntonioMrtz |
Hi again @ErikMisencik . Frontend uses get artist streams endpoint so it will break this functionality. I will push frontend changes this afternoon ( probably a one liner) |
Hi @ErikMisencik , I'm done with frontend changes. I also tested the changes with frontend client and everything looks good. Thanks for contributing and sharing your time with the project. I'm adding you into the contributors list in both the docs and readme :). I hope too see you soon in the project, are you looking for other issues to contribute? |
Also thank you for opportunity to help and solve issue. Right now i am more focused on University, it's my last year in Master degree. So maybe in future when I'll be less busy. For now I am glad that I could help you with project. |
Thanks a lot @ErikMisencik . Feel free to drop by the project whenever you want :). I wish you the best on your master's degree 👍 |
Description
This PR refactor/implements the way total streams are calculated and retrieved for artists. Previously, artist total streams were fetched through a separate query via a dedicated endpoint (/artists/{name}/streams). With this update, total streams are now dynamically calculated as part of the artist data model (ArtistDAO and ArtistDTO) and retrieved directly through the main artist endpoint (/artists/{name}). As a result, redundant logic and endpoints related to fetching artist streams have been removed.
Additionally, the test for retrieving total streams has been updated to work with the new logic, ensuring proper functionality.
Commit type
refactor
: refactoring production code, eg. renaming a variableIssue
#227
Solution
Service
The dynamic calculation of total streams for an artist has been implemented within the ArtistDAO. The key changes are:
Endpoint
The following changes were made:
Tests
Tests have been updated to reflect the new logic for retrieving total streams:
Updated test: The test for retrieving an artist’s total streams now works with the new logic of fetching total streams through the main artist endpoint (/artists/{name}).
Removed redundant test: Any tests related to the /artists/{name}/streams endpoint were removed.
Proposed Changes
Potential Impact
This change simplifies the API by consolidating all artist-related data into a single endpoint, improving both performance and maintainability. Users will no longer use a separate endpoint to fetch total streams.
Screenshots
In the screenshot, the artist "Ade" has two uploaded songs: "era" and "looop", with a total of 6 streams. The total streams are dynamically calculated and retrieved via the /artists/{name} endpoint, summing up streams from all uploaded songs.
Additional Tasks
N/A
Assigned
@AntonioMrtz