mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Extract diff-name from diff-path when diff-name field is missing
This commit is contained in:
parent
54edb62bcf
commit
193672dae5
@ -1193,10 +1193,14 @@ const getAssetDiffDetails = assetKey => {
|
|||||||
const out = { name: assetKey };
|
const out = { name: assetKey };
|
||||||
const cacheEntry = assetCacheRegistry[assetKey];
|
const cacheEntry = assetCacheRegistry[assetKey];
|
||||||
if ( cacheEntry === undefined ) { return; }
|
if ( cacheEntry === undefined ) { return; }
|
||||||
if ( cacheEntry.diffPath === undefined ) { return; }
|
|
||||||
if ( cacheEntry.diffName === undefined ) { return; }
|
|
||||||
out.diffName = cacheEntry.diffName;
|
|
||||||
out.patchPath = cacheEntry.diffPath;
|
out.patchPath = cacheEntry.diffPath;
|
||||||
|
if ( out.patchPath === undefined ) { return; }
|
||||||
|
out.diffName = cacheEntry.diffName;
|
||||||
|
if ( out.diffName === undefined ) {
|
||||||
|
const match = /#.+$/.exec(out.patchPath);
|
||||||
|
if ( match === null ) { return; }
|
||||||
|
out.diffName = match[0].slice(1);
|
||||||
|
}
|
||||||
out.diffExpires = getUpdateAfterTime(assetKey, true);
|
out.diffExpires = getUpdateAfterTime(assetKey, true);
|
||||||
out.lastModified = cacheEntry.lastModified;
|
out.lastModified = cacheEntry.lastModified;
|
||||||
const assetEntry = assetSourceRegistry[assetKey];
|
const assetEntry = assetSourceRegistry[assetKey];
|
||||||
@ -1217,8 +1221,6 @@ async function diffUpdater() {
|
|||||||
const assetKey = toUpdate.shift();
|
const assetKey = toUpdate.shift();
|
||||||
const assetDetails = getAssetDiffDetails(assetKey);
|
const assetDetails = getAssetDiffDetails(assetKey);
|
||||||
if ( assetDetails === undefined ) { continue; }
|
if ( assetDetails === undefined ) { continue; }
|
||||||
if ( assetDetails.patchPath === undefined ) { continue; }
|
|
||||||
if ( assetDetails.diffName === undefined ) { continue; }
|
|
||||||
assetDetails.what = 'update';
|
assetDetails.what = 'update';
|
||||||
if ( (getWriteTime(assetKey) + assetDetails.diffExpires) > now ) {
|
if ( (getWriteTime(assetKey) + assetDetails.diffExpires) > now ) {
|
||||||
assetDetails.fetch = false;
|
assetDetails.fetch = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user