-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Playlists.py:There are more edge cases to be considered here. A couple of them that I picked up on were cases such as an empty playlist or invalid user ID, these might be good to implement in the future.Playlists.py: I would remove the separate classes you have in this file. The song, createPlaylist, and PlaylistIdResponse classes only have one attribute which seems unnecessary. I would either remove these all together or add more information to this classes (detailed in the next bullet point)Playlists.py: It could be nice to have a description attribute in the CreatePlaylist button and a public or private feature as well. If the playlist is public, it would appear on the user's account and other people could see that playlist. If it’s private, only the user themselves could see it.Playlists.py: It could be nice to be able to select multiple songs at a time to input into the playlist rather than one at a time.Playlists.py: Remove unused imports, such as Header from fastapi, if they are not used in the current code.Songs.py: Break down play_playlist into smaller functions. This function is doing a lot right now so it would be good to break it into smaller, more focused functions for better readability and maintainability. This can also help you optimize your SQL queries for better performance.Songs.py: The code makes additional unnecessary queries (e.g., SELECT * FROM users) when handling errors. This can be optimized.Songs.py: There is some code duplication in the play_song function, especially in the error-handling logic. It uses the same error-checking pattern repeatedly, this could be condensed. For example, you can have an error_message variable that you set to “Invalid user ID” or “Invalid song ID”, etc. You could then do a check if error_message and then return the error message at the end of this function to optimize.Songs.py: Consider adding a liked song feature. It could be cool for a user to see all the songs they have liked like how you can in Spotify and Apply Music.Users.py: the album and artist fields of the Platform class are never used.Users.py: I would add more error handling for delete_user and set_platform for if someone inputs an invalid user_id or an invalid password.Users.py: Consider using a more secure method for passwords. There are built in libraries that would be better to use instead of trying to implement your own hashing function. It would also automatically generate a salt and add other security benefits.
Metadata
Metadata
Assignees
Labels
No labels