Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add explicit tags to track information #276

Merged
merged 3 commits into from
Oct 23, 2023

Conversation

SebRollen
Copy link
Contributor

Fixes #96.

Adds (Explicit) to a track name if Spotify reports it as having explicit lyrics. This can make it easier to know if you're listening to the explicit version or the "radio" version of a song.

I originally tried to implement this functionality at the album level, using the restrictions field on the Album API, but the explicit field was not populated in any of my tests. This seems to match the behavior of the spotify web interface, were there is no explicit marker at the album level, but there is one at the track level.

Question for @braheezy (author of #96) and @aome510: what are your thoughts on modifying the track title by appending the string (Explicit)? Spotify's web interface obviously handles this a bit differently, adding an E symbol, but I wasn't sure how to translate that to the spotify_player interface. Another possiblity could be to add another column in the track-list, populating the column with E for explicit tracks and leaving it blank for non-explicit tracks.

Screenshots:

Explicit album track listing:
Screenshot 2023-10-22 at 8 28 10 PM

"Radio" album track listing:
Screenshot 2023-10-22 at 8 28 24 PM

Comment on lines 187 to 191
if track.explicit {
format!("{} (Explicit)", track.name)
} else {
track.name.clone()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The track variable here is an rspotify::FullTrack, not a spotify_player::Track, so I couldn't reuse the display_name method

Copy link
Owner

@aome510 aome510 left a comment

Choose a reason for hiding this comment

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

LGTM!

I originally tried to implement this functionality at the album level, using the restrictions field on the Album API, but the explicit field was not populated in any of my tests. This seems to match the behavior of the spotify web interface, were there is no explicit marker at the album level, but there is one at the track level.

I actually prefer handling explicitly at the track level because it's possible that a non-explicit album has some explicit tracks.

what are your thoughts on modifying the track title by appending the string (Explicit)

I go ahead to try using the 🅴 Unicode character instead of (Explicit). Not sure how well it is rendered on other platforms. Tested locally:

Screenshot 2023-10-22 at 9 23 20 PM

@SebRollen
Copy link
Contributor Author

I go ahead to try using the 🅴 Unicode character instead of (Explicit). Not sure how well it is rendered on other platforms.

Good idea! It looks pretty good on my system too, though a bit hard to read when the track is not highlighted:

Screenshot 2023-10-22 at 10 33 04 PM

I still prefer that approach to the "(Explicit)" text though.

One other symbol for consideration could be the 🇪 unicode character. Looks like this on my system:
Screenshot 2023-10-22 at 10 42 35 PM

@aome510
Copy link
Owner

aome510 commented Oct 23, 2023

hmm, look like the unicode is pretty platform-dependent. It's quite hard for me to look 🇪 if using a dark theme. I think we can either revert back to "(Explicit)" text or "(E)" text for short. I'll merge the PR with "(E)" text.

lmk if that also works for you.

@aome510 aome510 merged commit 68da72f into aome510:master Oct 23, 2023
3 checks passed
@SebRollen SebRollen deleted the explicit-tags branch November 6, 2023 15:38
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.

Explicit Albums on Artists Page
2 participants