This proposal consists of two of the smaller sized projects suggested on the MusicBrainz Wiki.
Personal Information
- Nickname: Jason
- IRC Nick: jasondk
- MB username: whirlwind
- Github: jdaok
- Time Zone: UTC-8
Create short music reviews on ListenBrainz using the CritiqueBrainz API
Project Overview
ListenBrainz should allow users to write short reviews for tracks, release groups, and artists directly through our website using the CritiqueBrainz API. This project aims to drive increased contributions of reviews to CritiqueBrainz by making it easier to submit them. Reviews submitted through this feature should also populate the ListenBrainz feed.
Project Description + Mockups
Users will be able to write reviews through the âMy Listensâ page.
The user will be prompted to select the entity to review and write the review directly from ListenBrainz.
Users will be able to view reviews that they and their followers wrote on their User Feed.
(clicking on the review card will open the full review on CritiqueBrainz)
Implementation
Submitting Reviews
The user will first authorize ListenBrainz to post reviews with their CritiqueBrainz account through OAuth 2 https://critiquebrainz.readthedocs.io/api/oauth2.html (The cb_auth_token will be stored in the âuserâ table).
Submitting reviews requires the entity MBID which can be retrieved with the track metadata:
Release Group MBID
Lastfm_release_mbid
: must lookupRELEASE_GROUP_MBID
using MB API.Otherwise, must lookup
release MBID
using LABS API (mbid-mapping),
then lookupRELEASE_GROUP_MBID
using MB API.
Artist MBID
Lastfm_artist_mbid:
can be used as is.
Artist_msid:
must lookupartist MBID
using LABS API (artist-credit-from-artist-msid)
Recording MBID
Must lookup
recording MBID
using LABS API (mbid-mapping).
submitReviewToCB()
will be added to send post requests to CBâs API.
Fetching Reviews to Display On User Feed
Currently the CritiqueBrainz API allows searching for reviews by CB user UUID (whereas LB uses musicbrainz_idâs instead). The CB API will be first modified to allow for searching reviews by musicbrainz_id.
The process of fetching reviews to display on the user feed:
Reviews would be searched for every musicbrainz_id
in the userâs following list and themselves.
Pin Favorite Recordings to Profile
Project Overview
Currently all a user can do to show their love for a recording is to âloveâ it or recommend it. This project aims to allow for ListenBrainz users to pin their favorite recording to their profiles with a short blurb. This feature will allow users to get a better idea of what kind of music their following circle is interested in and make user profiles more personalized.
Project Description + Mockups
Users will be able to pin recordings from their âMy Listensâ page.
The Pin Track modal will look like this: (Users will only be able to have one track pinned at a time and the typed blurb will be capped at 280 characters.)
When visiting other profiles the pinned track will display at the top of the âListensâ tab.
Also all tracks the user has ever pinned will be displayed on listenbrainz.org/user/username/pinned-tracks
(Tracks can be deleted from this tab as well).
On the User Feed: if anyone the User is following has a recording pinned, it will appear under the BrainzPlayer.
(one pinned recording will display per user).
Implementation
Database
A separate Postgres table will store pinned tracks:
pinned_track | |||
Column | Type | Nullable | Default |
id | SERIAL | ||
user_id | INTEGER | not null | |
track_metadata | JSONB | not null | |
blurb_content | VARCHAR | ||
currently_pinned | BOOLEAN | not null | TRUE |
created | TIMESTAMP (w/ tz) | not null | NOW() |
-
User_id
will referenceid
from the âuserâ table. -
track_metadata
will contain recording_msid, artist/release/track name, and additional info.
API + SQL
The new API routes and corresponding SQL queries will look like this:
Pin a track to the userâs profile and submit it to the server:
POST /pin/pin-track {
user_id: 63241,
track_metadata: {track metadata}
blurb_content: âMy favorite song right now!â
}
UPDATE pinned_track SET currently_pinned = FALSE WHERE user_id = :user_id AND currently_pinned = TRUE
INSERT INTO pinned_track (user_id, track_metadata, blurb_content, created)
// Returns response status
Unpin a track from the userâs profile and update the server:
POST /pin/unpin-track {
user_id: 63241,
}
UPDATE pinned_track SET currently_pinned = FALSE WHERE user_id = :user_id AND currently_pinned = TRUE
// Returns response status
Get the pinned track for a single user
GET /pin/user/<user_id>/get-user-pin {
user_id: 63241,
}
SELECT (user_id, track_metadata, blurb_content, created) FROM pinned_track WHERE user_id = :user_id AND currently_pinned = TRUE
// Returns json with pinned track or none
Get the pinned tracks of every user in a userâs following list
GET /pin/user/<user_id>/get-user-following-pins {
user_id: 63241,
}
// Will iterate over a list of musicbrainz IDâs.
SELECT (user_id, track_metadata, blurb_content, created) FROM pinned_track WHERE user_id = :user_id AND currently_pinned = TRUE
// Returns json with pinned tracks or none, and count
Get the pinned track history of a user
GET /pin/user/<user_id>/get-user-pin-history {
user_id: 63241,
}
SELECT (user_id, track_metadata, blurb_content, currently_pinned, created) FROM pinned_track WHERE user_id = :user_id
// Returns json with pinned tracks or none, and count
Delete a track from pinned history
POST /pin/delete-pin {
user_id: 63241,
track_metadata: {track metadata}
created: 1617436332
}
DELETE FROM pinned_track WHERE user_id = :user_id AND track_metadata = :track_metadata AND created = :created
// Returns response status
Timeline
Pre-Community Bonding Period
I plan to work on tickets and features to get more experience with the code structure, and related technical skills .
Community Bonding Period
- Modify CB API to support review search by
musicbrainzID
- Make sure there is a clear roadmap defined for both projects
Week 1-2: Begin CritiqueBrainz project
- Implement CB OAuth
- Create barebones âWrite Reviewâ modal
- Make sure the button calls
submitReviewToCB()
and submits for the correct entity.
- Make sure the button calls
- Write corresponding tests
Week 3-4:
- Write
get_cb_review_events()
- Implement UI components
- âWrite reviewâ modal
- Timeline Event Card
- Write frontend tests
Week 5:
- Buffer period to finish project if behind. Otherwise continue first evaluation
Week 6-7: Begin Pin Recording project
- Implement
pinned_track
schema - Write API endpoints + routes
- Write SQL queries
- Write corresponding tests
Week 8-9:
- Implement UI components
- Pin track modal
- Pinned track cards
- Pinned track history tab
- Pinned tracks list in user feed
- Write frontend tests
Week 10:
Buffer period to catch up if behind. Then finish writing documentation and fixing bugs or start on stretch goals. final evaluation!
Stretch Goals / Post-GSOC Ideas :
- âReviewsâ tab that shows userâs CritiqueBrainz reviews on LB profiles
- User feed customization: allow users to filter which events they want to see on their feed (only display listens, reviews, etc.)
Information About Me
I am a sophomore studying computer science who will be attending University of California, Davis in the fall. I started contributing to ListenBrainz in January.
Tell us about the computer(s) you have available for working on your GSoC project!
I have a desktop computer running Windows 10 with an Intel i7 processor and 8 GB RAM.
When did you first start programming?
My first experiences programming were making ROBLOX games in middle school (but I only started to take programming seriously in high school).
What type of music do you listen to? (Please list a series of MBIDs as examples.)
I listen to a lot of experimental pop music and R&B. I also like electronic and dance music.
What aspects of the project youâre applying for (e.g., MusicBrainz, AcousticBrainz, etc.) interest you the most?
Iâm an obsessive tracker of my listening history, I love music, metadata, and collecting information about my listening habits The music data that LB collects is public which is useful in building tools that improve music recommendation technologies. The ListenBrainz project stands out because itâs open source and any passionate individual can contribute.
Have you ever used MusicBrainz to tag your files?
I havenât used MusicBrainz to tag my files yet.
Have you contributed to other Open Source projects? If not, do you have other code we can look at?
I am new to open source but many of my projects can be found on my GitHub.
What sorts of programming projects have you done on your own time?
I have made a lot of interactive websites as portfolios or shops or calculators.
How much time do you have available, and how would you plan to use it?
I will likely be able to dedicate 40+ hours to GSoC each week.
Do you plan to have a job or study during the summer in conjunction with Summer of Code?
I would be working part time on the weekends but it should not interfere with my availability for GSoC significantly, and I will be out of school and available for the entire duration of the program.