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

feat(inline recs): Order tracks by ascending release dates #764

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

jesus2099
Copy link
Contributor

@jesus2099 jesus2099 commented May 2, 2024

For the moment, release tracks were displayed in random order.
Now they will be ordered by date, then title, then comment.

I have also added display of release comment and added release date as tooltip.


@ROpdebee, may I leave you manage the version number, OK?
My 3 concurrent PR have no conflict between themselves:

@jesus2099 jesus2099 changed the title Sort tracks by release dates feat(inline recs): Order tracks by ascending release dates May 2, 2024
@jesus2099
Copy link
Contributor Author

Hmm.
I see those 2 redundant commits have the same content but not the same ID.
I will try to make them disappear from this PR, as soon as I have time and PC again.

@jesus2099 jesus2099 marked this pull request as draft May 3, 2024 07:55
@jesus2099 jesus2099 force-pushed the sort-tracks-by-release-dates branch from b660bda to 613209f Compare May 5, 2024 19:31
@jesus2099 jesus2099 marked this pull request as ready for review May 5, 2024 19:42
@jesus2099
Copy link
Contributor Author

Super! I managed to repair my stuff, thanks to a PC with TortoiseGit (requires admin rights).

@jesus2099
Copy link
Contributor Author

jesus2099 commented May 8, 2024

Ah, I should also add medium and track in the sort.
I use this release as a test, and this medium.track:

9 シェンファ 〜江清日抱花歌〜
appears on: Shenmue Juke Box (#1.13)
appears on: Shenmue: Orchestra Version (#1.8)
appears on: Shenmue: Orchestra Version (#1.9)
appears on: 莎木(シェンムー) Orchestra Version (#1.9)
appears on: 莎木(シェンムー) Orchestra Version (#1.8)
appears on: Shenmue: Orchestra Version (#1.8)
appears on: シェンムー Orchestra Version (#1.8)
appears on: 莎花 (#1.1)
appears on: Shenhua 〜Jiang Qing Ri Bao Hua Ge〜 (#1.1)

We see they are in random order twice: 1.8, 1.9 (good) but then 1.9, 1.8 (no good).

@jesus2099 jesus2099 marked this pull request as draft May 8, 2024 13:54
@jesus2099 jesus2099 marked this pull request as ready for review May 8, 2024 14:40
@jesus2099 jesus2099 force-pushed the sort-tracks-by-release-dates branch from c74a5a6 to 79fa5ab Compare May 25, 2024 17:33
@jesus2099
Copy link
Contributor Author

jesus2099 commented May 25, 2024

I have reset the version to previous value to avoid boring git conflicts with other PR.
Doing so, I noticed the @exclude rules were not working as intended and fixed them.
I have also added musicbrainz.eu support.

Moved to #777

Display total tracks in tooltip
Cosmetic fixes
@jesus2099 jesus2099 force-pushed the sort-tracks-by-release-dates branch from 79fa5ab to 6fe3015 Compare June 10, 2024 15:57
@jesus2099
Copy link
Contributor Author

I renamed my commits to pass that test.

@jesus2099
Copy link
Contributor Author

jesus2099 commented Jul 11, 2024

Ach, I cannot rephrase that last commit to start with "fix(inline recs):" add I'm on smartphone...

I have fixed the "not detecting video recordings" bug without breaking, without detecting recordings from online relationships, hopefully no other breakages.

Release with video recordings: https://musicbrainz.org/release/0a5be94f-3429-46bd-9b1d-07dcb0209098

Release with recordings in inline relationships (on CD 23): https://musicbrainz.org/release/70dcde39-81ed-45e8-bdb3-f511112a3880

Moved to #776

@jesus2099
Copy link
Contributor Author

Maybe you'll prefer 3 separate PR.
I'll split it when I have a PC handy.

@jesus2099 jesus2099 marked this pull request as draft July 14, 2024 15:20
@jesus2099 jesus2099 force-pushed the sort-tracks-by-release-dates branch from 63e1e22 to 707b4d6 Compare July 20, 2024 15:47
@jesus2099 jesus2099 marked this pull request as ready for review July 20, 2024 15:52
Copy link
Collaborator

@kellnerd kellnerd left a comment

Choose a reason for hiding this comment

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

I feel that it is a bit too hacky to inject an HTML comment into the DOM just for sorting purposes. It would be cleaner to sort the releases with a custom sorting function before mapping them to HTML with formatRow.

P.S. Since I don't have permissions to push directly to the main branch, you can also re-add the version bump commit to this PR.

@jesus2099
Copy link
Contributor Author

Ok, I will try to do that! 😉

jesus2099 added a commit to jesus2099/ROpdebee_mb-userscripts that referenced this pull request Jul 25, 2024
Instead of HTML comment sorting hack
Improves ROpdebee#764 with this @kellnerd advice
@jesus2099 jesus2099 force-pushed the sort-tracks-by-release-dates branch from 3ce288b to 267e206 Compare July 25, 2024 20:27
@jesus2099
Copy link
Contributor Author

jesus2099 commented Jul 25, 2024

You were right, @kellnerd: With the sorting function, the code looks cleaner!
You can squash, if you want.

@jesus2099
Copy link
Contributor Author

Would you like that I squash this into a single commit, before merge?

Copy link
Owner

@ROpdebee ROpdebee left a comment

Choose a reason for hiding this comment

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

Thank you @jesus2099 for this and the other PRs, and thanks @kellnerd for reviewing and processing them while I'm pre-occupied! ❤️

Just a small nitpick: Could you also change the month in the version number? Other than that, LGTM.

@jesus2099 Don't bother squashing the commits, we'll do that when merging. 🙂

Instead of HTML comment sorting hack
Improves ROpdebee#764 with this @kellnerd advice
@jesus2099 jesus2099 force-pushed the sort-tracks-by-release-dates branch from 267e206 to ede535a Compare July 26, 2024 15:46
@jesus2099 jesus2099 requested a review from ROpdebee July 26, 2024 15:48
@jesus2099
Copy link
Contributor Author

Oh you're right, I got the wrong date!
You're welcome @ROpdebee!
I hope your worries will be solved.

@ROpdebee ROpdebee merged commit f4d91a1 into ROpdebee:main Jul 26, 2024
11 checks passed
@jesus2099 jesus2099 deleted the sort-tracks-by-release-dates branch July 26, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants