-
Notifications
You must be signed in to change notification settings - Fork 177
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 Last updated sorting option for locally installed mods #1119
base: master
Are you sure you want to change the base?
Conversation
Add LAST_UPDATED to the enum referenced when sorting local mods
Add ability to sort installed mods by last updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! On the surface this looks good, but I'd have to test it before merging and that'll probably take at least a week or two before I get to it.
Bonus points for adding test cases, nice 👍
Not sure what's going on with the commit history though but that's not a blocker
@@ -62,6 +62,8 @@ export default class ModListSort { | |||
return a.getAuthorName().localeCompare(b.getAuthorName()); | |||
case SortNaming.CUSTOM: | |||
return 0; | |||
case SortNaming.LAST_UPDATED: | |||
return b.getDateUpdated().toISOString().localeCompare(a.getDateUpdated().toISOString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason we're doing a string comparison instead of comparing dates directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember off the top of my head, but I don't think it was working when I tried to compare dates directly. Not sure why that wouldn't work though, so maybe it wasn't working because I was doing something else wrong. I'll look at it later today and see if I can figure out why I did that.
And as for the commit history, I just had a series of consecutive brain farts lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man this is an update i've been waiting on forever! Crazy to see someone forked it out and tested it :)
I thought #1039 was a good feature for the manager to have, so I decided to take a stab at implementing it. In order to get this change to work, I added a new sort type to the local mods sorting options enum, added a new sort case for that enum, and modified ManifestV2 to store dateUpdated and receive dateUpdated information from inputs that provide it.