-
Notifications
You must be signed in to change notification settings - Fork 52
Conversation
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.
Not tested but looks okay.
Tested, BREAKING : you cannot upload more than one file at once.
Fixed.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Also fixes: LycheeOrg/Lychee#443 |
@@ -50,7 +50,7 @@ let lychee = { | |||
|
|||
album_subtitle_type: "oldstyle", | |||
|
|||
upload_processing_limit: 4, | |||
upload_processing_limit: 2, |
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.
Why did you change it to 2
? And why only in this least important place?
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 was testing. :'D
@@ -252,7 +252,7 @@ lychee.init = function () { | |||
lychee.admin = !lychee.api_V2; | |||
lychee.nsfw_visible_saved = lychee.nsfw_visible; | |||
|
|||
lychee.upload_processing_limit = parseInt(data.config.upload_processing_limit); | |||
lychee.upload_processing_limit = parseInt(data.config.upload_processing_limit) || 4; |
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.
This is wrong. This prevents the value of 0
from being used. I don't think we can use this ||
syntax for numerals that can be 0
.
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.
Hummmm indeed, I did not think about this. The problem is that if you send null
to parseInt
you get NaN
which obviously crash all the upload checks afterwards.
Implements a limit on the number of photos being simultaneously processed during upload. I expected that adding this would complicate the
process
function but in fact it simplified it (since it was needlessly complicated to begin with).This implements what was discussed in LycheeOrg/Lychee#903 and LycheeOrg/Lychee#913. The default limit is
4
. Setting it to0
disables the limit.There will be a trivial corresponding server-side PR that adds a config variable.