Remove Cooldown Prediction.
Conflicts: src/General/Config.coffee src/Posting/QR.cooldown.coffee
This commit is contained in:
parent
0af1575796
commit
ca9e147486
@ -327,10 +327,6 @@ Config =
|
|||||||
true
|
true
|
||||||
'Indicate the remaining time before posting again.'
|
'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.'
|
|
||||||
]
|
|
||||||
'Posting Success Notifications': [
|
'Posting Success Notifications': [
|
||||||
true
|
true
|
||||||
'Show notifications on successful post creation or file uploading.'
|
'Show notifications on successful post creation or file uploading.'
|
||||||
|
|||||||
@ -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]
|
||||||
@ -33,10 +31,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
|
||||||
@ -65,7 +59,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
|
||||||
@ -96,9 +90,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 -= Math.floor post.file.size / upSpd * upSpdAccuracy
|
|
||||||
seconds = if seconds > 0 then seconds else 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