diff options
author | Ajay Ramachandran <[email protected]> | 2021-01-17 12:53:31 -0500 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-01-17 12:53:31 -0500 |
commit | 7307340afa08f681f0c4a8ae8c64954dc4d67056 (patch) | |
tree | 93ac9e3b7b49e41e9abb3d7cfeff963613eeb72f | |
parent | e32a251ef374c1dbffb9f36b0fa0349898089bec (diff) | |
download | SponsorBlock-7307340afa08f681f0c4a8ae8c64954dc4d67056.tar.gz SponsorBlock-7307340afa08f681f0c4a8ae8c64954dc4d67056.zip |
Remove empty unsubmitted segments
Resolves https://github.com/ajayyy/SponsorBlock/issues/609
-rw-r--r-- | src/config.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/config.ts b/src/config.ts index 2a40dbf6..c64800e8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -247,10 +247,10 @@ const Config: SBObject = { * * @param data */ -function encodeStoredItem<T>(data: T): T | Array<any> { +function encodeStoredItem<T>(data: T): T | Array<[string, Array<SponsorTime>]> { // if data is SBMap convert to json for storing if(!(data instanceof SBMap)) return data; - return Array.from(data.entries()); + return Array.from(data.entries()).filter((element) => element[1] === []); // Remove empty entries } /** |