GSOC 2024: Artist, Album, User Pages in ListenBrainz Android App for all users
About me
Contact Information
Nickname : Pranav
IRC Nick : pranavkonidena
Matrix Handle : pranav / pranavkonidena
TimeZone: UTC +05:30
Email : [redacted]
GitHub : https://github.com/pranavkonidena
Devfolio: https://devfolio.co/@pranav2211
LinkedIn: https://www.linkedin.com/in/pranav-konidena-45102b25b/
I am Pranav Konidena, a sophomore at the Indian Institute of Technology Roorkee (IITR). I am deeply interested in exploring all spheres of software development. I currently work as a mobile developer at the Information Management Group. Information Management Group is a student group tasked with developing niche applications that make the digital stay of every student at IIT Roorkee as comfortable as possible. After a long day, I like to code something or play table tennis with my friends. I also love watching Formula 1 (Forza Ferrari) and football (Hala Madrid!). Oh, I forgot to mention I am a colossal fiction fan.
Why me?
I have an inherent love for programming and have explored many diverse fields in the area. I, along with two friends, participated in the BackDoor CTF (Capture The Flag) event hosted by InfoSec IITR, one of Indiaās best undergraduate CTF teams. We were placed 14th out of 200+ teams who participated. I also have over 4000 points on PicoGym on PicoCTF. When I started contributing to LB Android, I had no prior experience in Kotlin. I went through many medium articles and started to get the hang of Kotlin and ComposeUI. I received valuable PR reviews from Jasje and Akshaaatt, which have taught me much about the coding practices used in organizations. I am a great team player and know the community well. Having been in constant touch for 4+ months, I am confident I can complete the project and learn a lot from this experience.
Why MetaBrainz?
I have been a user of MusicBrainz and ListenBrainz since July 2023. I love music and spend ~2-3 hrs a day listening to music. So, I wanted to make my music tracker (I wanted to check minutes listened, minutes of artists listened, etc., something like Spotify wrapped but not only in December), and thatās how I came across MetaBrainz. Participating in GSoC has been one of my long-term aims. When I saw that MetaBrainz had participated in GSoC earlier, I was thrilled and began contributing to MetaBrainz in December 2023.
My Contributions in MetaBrainz so far
I currently have 11 merged PRās and 1 open PR in ListenBrainz Android which can be viewed here. I have also contributed to ListenBrainz Server and have 2 merged PRās which can be viewed here.
Proposed Project
Project Overview
Currently, the ListenBrainz website contains a lot of features such as User Pages, Album Pages and Artist Pages, which offer a holistic experience to the users. However, there is a lack of unified experience for users as some of the features offered by the LB Website listed above need to be present in the app. As a contributor of the LB App since December 2023, my understanding of the app is that it is a fusion of three things. Listen Submission, Social Media, Music. For any music app with a fusion of social media, user, artist, and album pages are a must, and this project aims to achieve that.
Project Goals
According to the LB GSoC ideas page, the project goals are as follows.
-
User Pages:
Enhance user profiles to include detailed listening statistics, favourite tracks, albums, and artists. Implement a feature for users to follow others and explore music communities within the app.
-
Artist Pages:
Offer comprehensive artist profiles featuring a biography, discography, related artists, and upcoming events. This will enable users to discover new music and learn more about their favourite artists.
-
Album Pages:
Display detailed album information, including track lists, release dates, genres, and artist links. Integration with music streaming services to listen to tracks directly from the app may also be explored.
Project Size
Large (350 hrs)
Plan of Action for the project
Planning:
The user pages are the most important and involved part of this project. For better management and ease of working, I have divided the entire project into three parts as shown respectively. These are all the features I would be implementing as a part of this GSoC project. Extended Goals are listed, and provided I have additional time, I will be completing them.
Part of the Project | Final Deliverables |
User Pages
(Part 1) |
|
Artist Pages (Part 2) |
|
Album Pages
(Part 3) |
|
Note:
The layout for all parts of the project would be similar to that of LB Web. This means that the UserPage screen would have four tabs (Listens, Stats, Taste, Playlists and Created for You)
For implementation details, kindly see the APIs and the coding sections.
Design:
Tentative User Flow:
The figma file for the user flow may be found here.
As we can see, the three pages will be linked together, and the user can easily navigate to different pages from each page.
UI MockUps:
Mockups will be prepared and finalized by having discussions with the in-house designer of MetaBrainz, Aerozol. For mockups of the artist, album, and user pages, you can find the relevant figma file here. The design is still in a very nascent stage and will be updated soon. The wireframes for the layout of the screens are given here. Some mockups of the artist pages are attached below.
Knowing the APIās:
Please note that some of these API Calls are already implemented in the corresponding services within the app ( e.g. ā Recent Listens of User is already implemented in the ListensService file). Hence, I would be reusing all implemented calls and writing only those calls in service files that still need to be implemented.
Note: Base URL for all API calls is : api.listenbrainz.org as given in the docs
User Pages:
-
Recent Listens of User
Request : GET /1/user/(user_name)/listens
About:
Get listens for user user_name. -
Pins of User
Request : GET /1/(user_name)/pins/current
About:
Gets the current pins of the userās user_name. -
Total Amount of Listened Songs
Request : GET /1/user/(user_name)/listen-count
About:
Gets the total listen count of the user user_name -
Follow APIās
Request: GET /1/user/(user_name)/followers
Request : GET /1/user/(user_name)/following
About:
Get the followers of user user_name and the users that user user_name follows. -
Similar Users
Request: GET /1/user/(user_name)/similar-users
About:
Get a list of users in decreasing order of similarity with user user_name. Similarity score and username are received. -
Top Artists
Request : GET /1/stats/user/(user_name)/artists
About:
Get the top artists for user user_name -
Top Albums
Request: GET /1/stats/user/(user_name)/releases
About:
Get the top albums for user user_name -
Top Songs
Request: GET /1/stats/user/(user_name)/recordings
About:
Get the top songs for user user_name -
Listening Activity of User (Will be required while implementing the heat map of listens)
Request: GET /1/stats/user/(user_name)/listening-activity?range=year
About:
Get the number of songs listened to by the user every day for -
For Loved/Hated songs of User
Request : GET /1/feedback/user/(user_name)/get-feedback
About:
Get feedback given by user user_name -
For playlists:
Requests:
GET /1/user/(playlist_user_name)/playlists
GET /1/user/(playlist_user_name)/playlists/createdfor
GET /1/user/(playlist_user_name)/playlists/collaborator
GET /1/playlist/(playlist_mbid)
About:
Get all playlist MBIDs of a user. The ones in which a user is a collaborator, the playlists created for a user. We can fetch playlist details using the playlist mbid.
Artist Pages:
-
Wikipedia Extract of Artist
Request:
GET https://musicbrainz.org/artist/{artist_mbid}/wikipedia-extract -
Top Tracks of Artist
Request:
GET /popularity/top-recordings-for-artist?artist_mbid=(artist_mbid)tistMBID}
-
Artist Metadata
Request: GET /metadata/artist/?artist_mbids=(artist_mbid) -
Reviews of Artist
Request : GET https://critiquebrainz.org/ws/1/review/?limit=5&entity_id={artist_mbid}&entity_type=artist -
Top Release Groups of Artist
Request : GET /popularity/top-release-groups-for-artist?artist_mbid=$(artist_mbid) -
Top Listeners of Artist
Request : GET /popularity/top-release-groups-for-artist?artist_mbid=$(artist_mbid) -
Top Listeners of Release Group
Request : GET /1/stats/release-group/(release_group_mbid)/listeners
Album Pages -
Album Cover Art
**Request **: GET https://archive.org/download/mbid-${releaseMBID}/mbid-${releaseMBID}-${caaId}_thumb${size}.jpg -
Album Reviews
Request : GET https://critiquebrainz.org/ws/1/review/?limit=5&entity_id=${release_group_mbid}&entity_type=release_group
Timeline of project
Pre-Community Bonding Period (April 2 - May 1):
Iāll make progress for Figma Designs and continue work on other project ideas such as BrainzPlayer Revamp as Akshat suggested
Community Bonding Period (May 1 - May 26):
I will finalize the Figma mockups for all the screens and get them approved by Aerozol.
GSoC Coding Period:
Date | Week | Goals |
May 27 - Jun 3 | 1 |
|
Jun 3 - Jun 10 | 2 |
|
Jun 10 - Jun 17 | 3 |
|
Jun 17 - Jun 24 | 4 |
|
Jun 24 - Jul 1 | 5 |
|
Jul 1 - Jul 8 | 6 |
|
Jul 8 - Jul 15 | 7 |
|
Jul 15 - Jul 22 | 8 |
|
Jul 22 - Jul 29 | 9 |
|
Jul 29 - Aug 5 | 10 |
|
Aug 5 - Aug 12 | 11 |
|
Aug 12 - Aug 19 | 12 |
|
Aug 19 - Aug 26 |
|
I also plan to have weekly meetings with my mentor to discuss my progress after every weekly dev meeting to keep everyone updated.
Work may be affected in Week 8,9 as I will have several tests and interviews for the upcoming intern season.
Coding:
User Pages
UserService.kt
package org.listenbrainz.android.service
interface UserService {
@GET("{user_name}/pins")
suspend fun getUserPins(@Path("user_name") username : String) : Response<List<PinnedRecording>>
@GET("user/{user_name}/listen-count")
suspend fun getUserListenCount(@Path("user_name") username : String) : Response<Long>
@GET("stats/user/{user_name}/artists")
suspend fun getUserTopArtists(@Path("user_name") username : String) : Response<List<Artist>>
// And so on, I have given out implementation for a few of the unimplemented things for user pages,
// rest will be directly reused from the required services
}
UserViewModel.kt
package org.listenbrainz.android.viewmodel
@HiltViewModel
class UserViewModel @Inject constructor(
private val userRepository: UserRepository,
) : BaseViewModel<UserUiState>
{
private lateinit var username : String
// This function will be used to set the username, which is then used to get the necessary info for all user pages.
fun setUsername(username : String) {
this.username = username
}
init {
loadData()
}
suspend fun loadData () {
viewModelScope.launch {
userRepository.fetchUserData(username)
}
}
}
A similar flow would be maintained for the artist and album pages. Also, Iāll first try to create and use as many reusable components as possible, ensuring that adding new features to the app will be easy in the future. I would be creating UiStates for the UI to consume directly. The code structure would be adhering to the MVVM architecture, following the codebase structure and contribution guidelines sections in the overview document for LB-Android. To have swipe functionality in user pages, Iāll be using Horizontal Pager in ComposeUI.
Extended Goals:
-
Events in LB Artist Pages
This feature would notify users via push notifications when the artists they follow announce a tour. Also, a list of an artistās upcoming events would be on their page. This feature may also be region-specific after users set their location in the app/web.
-
Integration with music playing services to play music directly from LB-Android
As we would be implementing features such as Created for You, it makes sense that the user could play playlists and albums from the LB app directly. This feature aims to connect the LB app to several music-playing services so the user can play music directly from the LB app.
Additionally, please go through some extended questions and answers related to the proposal here
Post GSoC Plans
Post GSoC, I would like to continue working on LB Android and will try to contribute code in LB-Server and BookBrainz. I will work on making Year In Music for friends of users in the app (by making a generic activity and passing in the username as an extra with the intent). This will allow users to view their Music Buddiesās YIM in the app.
Community Affinities
What type of music do you listen to?
I love listening to a wide variety of music. It may be groovy Tamil songs or old classics. Some of my favourite artists are Anirudh Ravichander, Sam CS, Ritviz (Am in the top listenerās section hehe ).
My Favourite songsās MBIDās are:
5b93c3ee-18a8-42ae-9458-4e321402dfc1
dcd15c09-9aa6-4bc9-826a-1340a9e4cf0b,
d74ce039-fb99-44fb-aa54-43bf707acf46
My LB profile can be found here.
What aspects of MusicBrainz/ListenBrainz/BookBrainz/Picard interest you the most?
Of all the projects in MetaBrainz, my favourites are ListenBrainz and BookBrainz. I have been a member of ListenBrainz since July 2023 and love that I can check detailed insights of my listening history anytime I want. I mainly use BookBrainz to peruse other peopleās collections and to get some reading ideas. I loved the project and would love to contribute to BookBrainz.
Have you ever used any of our projects in the past?
I have been using ListenBrainz to scrobble my listens since July 2023 and BookBrainz to see peopleās collections of books, as mentioned above.
Programming Precedents
When did I first start programming?
I started programming in the first semester of my university. We have a thriving student group culture on campus, and one of the student groups took a workshop where we made chromeās dino game using JS. This was my first programming experience. After this workshop, I participated in my first ever hackathon where we made a python bot to notify users when the flight prices between a particular route are reduced. The project can be found here. I discovered my love for hackathons and programming from this event and have participated in many hackathons since then.
Have you contributed to other open-source projects? If so, which projects and can we see some of your code?
Yes, I have contributed code to the NoticeBoard App maintained by the Information Management Group. Over 15000 users use the app, and it acts as a link between the college administration and the students. All crucial notices are shared on the app.
You can find the app on PlayStore and AppStore.
Here is a link to the code :
Here is a link to my PRs
Features I have implemented:
- Added a network interceptor so that when users donāt have internet connectivity, they are notified via snackbar, and then when their connection is restored, notices are re-fetched
- Fixed a bug related to no UI updation when opening a notice via a deep link
What sorts of programming projects have you done on your own time?
-
AdaptiSync: AI-Based Real-Time Adaptive Traffic Control using Edge Computing
This is a project that I have been working on with Mr. Amit, who is one of my professors at our university. We use Jetson Xavier NX/Raspberry Pi 4 and Coral TPU for complete wireless traffic classification on an approach. This data is then transmitted back to our AWS server, where a RL algorithm gives out the best green phase durations for each approach. We use this to control the traffic signals on an approach dynamically. I have implemented the AWS server written in Flask and worked on object detection using the YOLO V8 nano model. The code is not open source yet, here is a brief of the components of this project
-
Amenity Reservation App
On entering the IIT Roorkee campus, many enthusiastic students have high expectations of leading a healthy lifestyle that includes body fitness and exploring a variety of skills by trying out different sports. However, there is a significant problem faced by many of these students, for example - students have experienced frequent situations wherein they go to play a sport or use a facility, e.g., table tennis. Still, they rarely get a chance to play those games because they always remain occupied. This app aims to solve this problem by allowing students to make bookings for different sports activities according to their needs.
Tech Stack:
Mobile App made with Flutter.
Backend made using Django Rest Framework.
Database used: MySQL
IDE used: Microsoft Visual Studio Code
Link to the appās code
Link to the backendās code
-
Smart Parking App
This was a project that I had made along with two friends for a hackathon. This IoT project uses ultrasonic sensors to detect the parking status of a slot. It sends this data to the server, which then dynamically provides the nearest empty slot to the user and directions for parking. We came in the top 10 out of over 150 teams.
Tech Stack :
Mobile App made with Flutter
Backend made with Flask
IDE used: Microsoft Visual Studio Code
Link to the code : https://github.com/iamgoeldhruv/carparking_app
There are several other projects made for fun/hackathons. You can find them here.
Practical Requirements
Development Setup for SOC
I currently have a MacBook Pro (2021, 14-inch version) with 16 GB RAM. The operating system is MacOS Sonoma 14.2.1, the kernel version is Darwin 23.2.0, and the architecture is ARM64. I use Android Studio Hedgehog to contribute code to ListenBrainz.
How much time are you available weekly, and how would you plan to use it?
Iāll have my university summer break during the GSoC coding period. I would have no other engagements during that period and could work on the project for ~35 hours a week.
References
https://developer.android.com/topic/architecture/ui-layer/stateholders
https://developers.google.com/open-source/gsoc/timeline
https://listenbrainz.readthedocs.io/en/latest/
https://musicbrainz.readthedocs.io/en/latest/terminology/index.html