mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 05:27:03 +03:00
Added support for old format.
This commit is contained in:
@@ -148,6 +148,15 @@ function decodeStoredItem(id: string, data) {
|
|||||||
console.error("Failed to parse SBMap: "+ id);
|
console.error("Failed to parse SBMap: "+ id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is the old format for SBMap (a JSON string)
|
||||||
|
if (typeof data === "string") {
|
||||||
|
let str = JSON.parse(data);
|
||||||
|
|
||||||
|
if(Array.isArray(data)) {
|
||||||
|
return new SBMap(id, str)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If all else fails, return the data
|
// If all else fails, return the data
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in New Issue
Block a user