Skip to content

Conversation

@SO9010
Copy link
Collaborator

@SO9010 SO9010 commented Nov 25, 2025

This is the PR for the feature #616.

image

This is doing a similar thing to how the homepage works and should have essentially the same functionality as the Spotify one. Something that needs discussing is how can we should all the playlists or followers?

@SO9010 SO9010 self-assigned this Nov 25, 2025
@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 1, 2025

We should make a placeholder icon for playlists with out cover images

@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 1, 2025

@jacksongoode I would like some input on the functionality please, currently, it just loads the first 10 for the artist and playlists, but we can get all of them, should we just load all of them in a scroll thing, or should we make it so we can say clikco nthe title to bring it to all of them?

Edit: I can change how many is gotten i think its cleaner if we leave it just showing 20 of them, but we should have a way to view all

@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 1, 2025

Ok so I have set the unloadable playlist to the default playlist icon, I will do the same for the users. I will add (un)follow next, then I will request a review!!

@SO9010 SO9010 marked this pull request as ready for review December 2, 2025 11:21
@SO9010 SO9010 requested a review from jacksongoode December 2, 2025 11:21
@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 2, 2025

Alright, I'm quite happy with where this is at now, @jacksongoode could you please look over the code as there is a lot of it XD

Copy link
Collaborator

@jacksongoode jacksongoode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice it looks great! Here's my first pass of comments.

Comment on lines +175 to +177
public_user_detail: PublicUserDetail {
info: Promise::Empty,
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason to create a struct to hold only the info? Otherwise this could be just a Promise?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in case we wanted to add the ability to view all for different elements, so for example you can have all of the user playlists or artists or friends there, and that imo would be better split into different parts?

Nav::SavedAlbums => "Saved Albums".to_string(),
Nav::Shows => "Podcasts".to_string(),
Nav::SearchResults(query) => query.to_string(),
Nav::PublicUserDetail(usr) => usr.get_display_name().to_string(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably use user :) just one more char.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also any reason we are using a getter here? Compared to just having it be a field like .name (like the others?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is the inconsistencies with the serialisation of public user, sometimes it is display_name and sometimes its name...

Comment on lines +57 to +79
// Update the is_following state in the cached data
if let Some(cached) = data.public_user_detail.info.resolved_mut() {
let info = Arc::make_mut(&mut cached.data);
info.is_following = Some(true);
info.followers_count += 1;
}
}
},
)
.on_command_async(
UNFOLLOW_USER,
|username| WebApi::global().unfollow_user(&username),
|_, _, _| {},
|_, data, (_username, r)| {
if let Err(err) = r {
data.error_alert(err);
} else {
data.info_alert("User unfollowed.");
// Update the is_following state in the cached data
if let Some(cached) = data.public_user_detail.info.resolved_mut() {
let info = Arc::make_mut(&mut cached.data);
info.is_following = Some(false);
info.followers_count -= 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it makes sense that we update these values, but do we ever actually refresh these values elsewhere? Not that it matters, just curious. I'm trying to think about how Psst might cache things, but some fields shouldn't really need to be cached if they are dynamic, like follower counts, listener counter perhaps.

Copy link
Collaborator Author

@SO9010 SO9010 Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't refresh them elsewhere :P, not actually sure why I did this like this anymore... Do you think I should change it?

#[serde(default)]
pub recently_played_artists: Vector<PublicUserArtist>,
#[serde(default)]
pub public_playlists: Vector<PublicUserPlaylist>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like perhaps this should just be a vec of playlists?

})
}

pub fn get_public_user_followers(&self, id: Arc<str>) -> Result<Vector<PublicUser>, Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some of these UI widgets can be abstracted here too.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess what I meant here is that get_public_user_followers, get_public_user_following are identical except for the request url and could be abstracted.

Co-authored-by: Jackson <[email protected]>
@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 2, 2025

Thanks for the review, I will go through this in a bit!

@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 5, 2025

Annoyingly psst isnt loading at all anymore, the program runs for me on all builds, but then the whole ui crashes... I hope your not getting the same issue...

Edit: Just needed a reboot XD

@SO9010
Copy link
Collaborator Author

SO9010 commented Dec 5, 2025

@jacksongoode I was looking into lazy scrolling with druid, and unfortunately, it be possible, at least in a clean way, there is no way I belive to append onto a list view...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants