Skip to content

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.

1 participant