Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/synchronizer.js

Issue 29946572: Issue 7094 - Keep subscription filters by text only (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase Created Feb. 16, 2019, 3:10 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/subscriptionClasses.js ('k') | test/filterListener.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 subscription.softExpiration = Math.round(softExpiration / MILLIS_IN_SECOND); 252 subscription.softExpiration = Math.round(softExpiration / MILLIS_IN_SECOND);
253 subscription.expires = Math.round(hardExpiration / MILLIS_IN_SECOND); 253 subscription.expires = Math.round(hardExpiration / MILLIS_IN_SECOND);
254 254
255 if (minVersion) 255 if (minVersion)
256 subscription.requiredVersion = minVersion; 256 subscription.requiredVersion = minVersion;
257 else 257 else
258 delete subscription.requiredVersion; 258 delete subscription.requiredVersion;
259 259
260 // Process filters 260 // Process filters
261 lines.shift(); 261 lines.shift();
262 let filters = []; 262 let filterText = [];
263 for (let line of lines) 263 for (let line of lines)
264 { 264 {
265 line = Filter.normalize(line); 265 line = Filter.normalize(line);
266 if (line) 266 if (line)
267 filters.push(Filter.fromText(line)); 267 filterText.push(line);
268 } 268 }
269 269
270 filterStorage.updateSubscriptionFilters(subscription, filters); 270 filterStorage.updateSubscriptionFilters(subscription, filterText);
271 } 271 }
272 272
273 _onDownloadError(downloadable, downloadURL, error, channelStatus, 273 _onDownloadError(downloadable, downloadURL, error, channelStatus,
274 responseStatus, redirectCallback) 274 responseStatus, redirectCallback)
275 { 275 {
276 let subscription = Subscription.fromURL(downloadable.url); 276 let subscription = Subscription.fromURL(downloadable.url);
277 subscription.lastDownload = Math.round(Date.now() / MILLIS_IN_SECOND); 277 subscription.lastDownload = Math.round(Date.now() / MILLIS_IN_SECOND);
278 subscription.downloadStatus = error; 278 subscription.downloadStatus = error;
279 279
280 // Request fallback URL if necessary - for automatic updates only 280 // Request fallback URL if necessary - for automatic updates only
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 339
340 /** 340 /**
341 * This object is responsible for downloading filter subscriptions whenever 341 * This object is responsible for downloading filter subscriptions whenever
342 * necessary. 342 * necessary.
343 * @type {Synchronizer} 343 * @type {Synchronizer}
344 */ 344 */
345 let synchronizer = new Synchronizer(); 345 let synchronizer = new Synchronizer();
346 346
347 exports.Synchronizer = synchronizer; 347 exports.Synchronizer = synchronizer;
OLDNEW
« no previous file with comments | « lib/subscriptionClasses.js ('k') | test/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld