Index: lib/synchronizer.js |
=================================================================== |
--- a/lib/synchronizer.js |
+++ b/lib/synchronizer.js |
@@ -195,21 +195,20 @@ |
if (downloadable.redirectURL && |
downloadable.redirectURL != downloadable.url) |
{ |
let oldSubscription = Subscription.fromURL(downloadable.url); |
subscription.title = oldSubscription.title; |
subscription.disabled = oldSubscription.disabled; |
subscription.lastCheck = oldSubscription.lastCheck; |
- let listed = (oldSubscription.url in FilterStorage.knownSubscriptions); |
- if (listed) |
kzar
2018/06/07 13:52:26
But we already have `listed` here, but now we don'
Manish Jethani
2018/06/07 14:29:46
Yeah I have to admit the last change is not exactl
|
- FilterStorage.removeSubscription(oldSubscription); |
+ let listed = FilterStorage.knownSubscriptions.has(oldSubscription.url); |
+ FilterStorage.removeSubscription(oldSubscription); |
- delete Subscription.knownSubscriptions[oldSubscription.url]; |
+ Subscription.knownSubscriptions.delete(oldSubscription.url); |
if (listed) |
FilterStorage.addSubscription(subscription); |
} |
// The download actually succeeded |
subscription.lastSuccess = subscription.lastDownload = Math.round( |
Date.now() / MILLIS_IN_SECOND |
@@ -330,17 +329,17 @@ |
request.channel.loadFlags = request.channel.loadFlags | |
request.channel.INHIBIT_CACHING | |
request.channel.VALIDATE_ALWAYS; |
request.addEventListener("load", ev => |
{ |
if (onShutdown.done) |
return; |
- if (!(subscription.url in FilterStorage.knownSubscriptions)) |
+ if (!FilterStorage.knownSubscriptions.has(subscription.url)) |
return; |
let match = /^(\d+)(?:\s+(\S+))?$/.exec(request.responseText); |
if (match && match[1] == "301" && // Moved permanently |
match[2] && /^https?:\/\//i.test(match[2])) |
{ |
redirectCallback(match[2]); |
} |