freesound icon indicating copy to clipboard operation
freesound copied to clipboard

Featured sounds in user profile page an pack page

Open ffont opened this issue 2 years ago • 2 comments

As a user I'd like to manually select a number of sounds that will appear as "featured" in my profile page instead of the last 12 sound being selected by default. The same thing should be possible for packs.

This would be a great new feature to be added to profile and pack pages (and also in future collection pages when we work on them). Users should be able to select N sounds and it should be stored in database which are these sounds. Then, a method should be added to the Profile and Pack models to get_featured_sounds(num_sounds=12) which will get featured sounds form those saved in the DB (if any) and, if needed, add extra sounds in reverse creation order to select a total of num_sounds.

We could simply add a text field in Profile and Pack models which store features sounds as a comma-separated list of sound IDs. Nevertheless, considering that this is a feature that only applies to a fraction of sound uploaders, it means that these fields would be empty for most users/packs, so maybe a better alternative would be to make a FeaturedSound model which links sounds with Profile or Pack objects. This model should also store the order of the sound in the featured list.

We should add UI widgets in the account settings and pack edit pages so users could select the featured sounds. The existing sound selector widget could be re-used, however in this case it should be limited to the sounds created by the user (like the current sound selector used for pack editing). The sound selector should however be updated to support sorting. This might be a bit tricky but it could be a nice addition. sortable should therefore be an option of the sound selector which can be enabled when order is relevant.

ffont avatar Dec 18 '23 15:12 ffont

Maybe @alastair you have a suggestion for the best way to store featured sounds?

ffont avatar Dec 18 '23 15:12 ffont