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

Add Last updated sorting option for locally installed mods #1119

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

Conversation

grahameron
Copy link

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.

@CLAassistant
Copy link

CLAassistant commented Dec 6, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@MythicManiac MythicManiac left a 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());
Copy link
Collaborator

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?

Copy link
Author

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

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 :)

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

4 participants