Remove Cooldown Prediction.
This commit is contained in:
parent
d1090b52fa
commit
e062f1626f
@ -62,7 +62,6 @@ Config =
|
|||||||
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.']
|
'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.']
|
||||||
'Hide Original Post Form': [true, 'Hide the normal post form.']
|
'Hide Original Post Form': [true, 'Hide the normal post form.']
|
||||||
'Cooldown': [true, 'Indicate the remaining time before posting again.']
|
'Cooldown': [true, 'Indicate the remaining time before posting again.']
|
||||||
'Cooldown Prediction': [true, 'Decrease the cooldown time by taking into account upload speed. Disable it if it\'s inaccurate for you.']
|
|
||||||
<% if (type === 'crx') { %>
|
<% if (type === 'crx') { %>
|
||||||
'Tab to Choose Files First': [false, 'Tab to the file input before the submit button.']
|
'Tab to Choose Files First': [false, 'Tab to the file input before the submit button.']
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
@ -7,8 +7,6 @@ QR.cooldown =
|
|||||||
$.off window, 'cooldown:timers', setTimers
|
$.off window, 'cooldown:timers', setTimers
|
||||||
for type of QR.cooldown.types
|
for type of QR.cooldown.types
|
||||||
QR.cooldown.types[type] = +QR.cooldown.types[type]
|
QR.cooldown.types[type] = +QR.cooldown.types[type]
|
||||||
QR.cooldown.upSpd = 0
|
|
||||||
QR.cooldown.upSpdAccuracy = .5
|
|
||||||
key = "cooldown.#{g.BOARD}"
|
key = "cooldown.#{g.BOARD}"
|
||||||
$.get key, {}, (item) ->
|
$.get key, {}, (item) ->
|
||||||
QR.cooldown.cooldowns = item[key]
|
QR.cooldown.cooldowns = item[key]
|
||||||
@ -31,10 +29,6 @@ QR.cooldown =
|
|||||||
if delay
|
if delay
|
||||||
cooldown = {delay}
|
cooldown = {delay}
|
||||||
else
|
else
|
||||||
if post.file
|
|
||||||
upSpd = post.file.size / ((start - req.uploadStartTime) / $.SECOND)
|
|
||||||
QR.cooldown.upSpdAccuracy = ((upSpd > QR.cooldown.upSpd * .9) + QR.cooldown.upSpdAccuracy) / 2
|
|
||||||
QR.cooldown.upSpd = upSpd
|
|
||||||
cooldown = {isReply, threadID}
|
cooldown = {isReply, threadID}
|
||||||
QR.cooldown.cooldowns[start] = cooldown
|
QR.cooldown.cooldowns[start] = cooldown
|
||||||
$.set "cooldown.#{g.BOARD}", QR.cooldown.cooldowns
|
$.set "cooldown.#{g.BOARD}", QR.cooldown.cooldowns
|
||||||
@ -61,7 +55,7 @@ QR.cooldown =
|
|||||||
isReply = post.thread isnt 'new'
|
isReply = post.thread isnt 'new'
|
||||||
hasFile = !!post.file
|
hasFile = !!post.file
|
||||||
seconds = null
|
seconds = null
|
||||||
{types, cooldowns, upSpd, upSpdAccuracy} = QR.cooldown
|
{types, cooldowns} = QR.cooldown
|
||||||
|
|
||||||
for start, cooldown of cooldowns
|
for start, cooldown of cooldowns
|
||||||
start = +start
|
start = +start
|
||||||
@ -92,9 +86,6 @@ QR.cooldown =
|
|||||||
type += '_intra' if isReply and +post.thread is cooldown.threadID
|
type += '_intra' if isReply and +post.thread is cooldown.threadID
|
||||||
seconds = Math.max seconds, types[type] - elapsed
|
seconds = Math.max seconds, types[type] - elapsed
|
||||||
|
|
||||||
if seconds and Conf['Cooldown Prediction'] and hasFile and upSpd
|
|
||||||
seconds -= post.file.size // (upSpd * upSpdAccuracy)
|
|
||||||
seconds = Math.max seconds, 0
|
|
||||||
# Update the status when we change posting type.
|
# Update the status when we change posting type.
|
||||||
# Don't get stuck at some random number.
|
# Don't get stuck at some random number.
|
||||||
# Don't interfere with progress status updates.
|
# Don't interfere with progress status updates.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user