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:
@@ -149,6 +149,15 @@ function decodeStoredItem(id: string, data) {
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user