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

[Server v2] Various improvements #317

Closed
wants to merge 0 commits into from

Conversation

ale-ben
Copy link

@ale-ben ale-ben commented Jan 12, 2025

No description provided.

@ale-ben ale-ben changed the title Job logic improvements [Server v2] Job logic improvements Jan 12, 2025
@ale-ben ale-ben force-pushed the postgres-Server-V2 branch from 7ccc3cf to dd1d67a Compare January 12, 2025 14:41
@ale-ben ale-ben mentioned this pull request Jan 12, 2025
@@ -89,11 +100,11 @@ public bool IsDownloaded()

private static int CompareChapterNumbers(string ch1, string ch2)
{
var ch1Arr = ch1.Split('.').Select(c => int.Parse(c)).ToArray();
var ch2Arr = ch2.Split('.').Select(c => int.Parse(c)).ToArray();
int[] ch1Arr = ch1.Split('.').Select(c => int.Parse(c)).ToArray();
Copy link
Owner

Choose a reason for hiding this comment

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

Probably should use TryParse instead, unless you can ensure that the strings are definitely in the expected format.

Copy link
Author

Choose a reason for hiding this comment

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

TBH String chapters are still a work in progress...
I started them, then got derailed by the jobs looping problem, and now I'm fixing the ID part.
As soon as I finish IDs I promise I'll get back at chapter numbers, fix and test all this

API/Tranga.cs Outdated
if (notifications.Any())
{
var max = notifications.MaxBy(n => n.Date)!.Date;
DateTime max = notifications.MaxBy(n => n.Date)!.Date;
Copy link
Owner

Choose a reason for hiding this comment

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

FYI, PGSQL does UTC Times only. So whenever we do comparisons, better use UTCNow.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, this was due to the formatter config, sorry! I'll fix it ASAP

Copy link
Owner

Choose a reason for hiding this comment

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

This was just general information, nothing to fix! 👍🏼

@C9Glax
Copy link
Owner

C9Glax commented Jan 12, 2025

Let's move #167 conversation to here instead 👍🏼

@C9Glax
Copy link
Owner

C9Glax commented Jan 12, 2025

6a8df2f
Tried my hand at a Token-Generator with input keys.

@ale-ben
Copy link
Author

ale-ben commented Jan 12, 2025

Screenshot 2025-01-12 at 19 13 29

I reached almost the same result, I kept the possibility to generate random for stuff that does not need a consistent ID (jobs, notifications, ...)
I haven't had the time to test yet though

@ale-ben
Copy link
Author

ale-ben commented Jan 12, 2025

Considering the column size of 64, my solution takes 32 char for the token and leaves 32 for the eventual prefix

@ale-ben
Copy link
Author

ale-ben commented Jan 12, 2025

Just noticed I'm missing the prefix concatenation after the token geneation but otherwise seems to work

@ale-ben ale-ben closed this Jan 25, 2025
@ale-ben ale-ben force-pushed the postgres-Server-V2 branch from 7dc34c1 to be6b3da Compare January 25, 2025 10:49
@ale-ben ale-ben changed the title [Server v2] Job logic improvements [Server v2] Various improvements Jan 25, 2025
@ale-ben
Copy link
Author

ale-ben commented Jan 25, 2025

Had some troubles with syncing your commits, I think it's best if I make (and merge) stuff when ready, otherwise conflicts are bound to happen

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.

2 participants