Showing release year on search result listings and artist pages#1024
Open
danielpietzsch wants to merge 4 commits intoRigellute:masterfrom
Open
Showing release year on search result listings and artist pages#1024danielpietzsch wants to merge 4 commits intoRigellute:masterfrom
danielpietzsch wants to merge 4 commits intoRigellute:masterfrom
Conversation
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.
danielpietzsch
commented
Sep 18, 2022
| // 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 |
Author
There was a problem hiding this comment.
If the above code can be improved, I’m all ears!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.