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

Showing release year on search result listings and artist pages #1024

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

danielpietzsch
Copy link

I was missing a “Release Year” info on search result and artist pages, which would help me decide what release from an artist I am looking for.

When I forked this, I noticed, that @jackson15j recently had already done something similar with album types (which I also greatly appreciate). So I build my solution on top of that.

Hope you’ll find this worthwhile, too, @Rigellute.

On smaller screens and/or with long album titles, all this new info – especially this new “release year” addition – might not show, because it’s appended to the release’s name (and hence will be cut off). But I still found this to be useful for a lot of artists and result pages.

on artist and search result pages

...adding this next to the release/album type
...into its own utility method, DRYing things up in the process.
// Getting those first four letters/digits should always work.
let album_release_year = album_item.release_date.as_deref().unwrap().get(0..4).unwrap();

album_item.album_type.as_deref().unwrap_or("unknown").to_owned() + ", " + album_release_year
Copy link
Author

Choose a reason for hiding this comment

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

If the above code can be improved, I’m all ears!

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.

None yet

1 participant