Remove empty unsubmitted segments

Resolves https://github.com/ajayyy/SponsorBlock/issues/609
This commit is contained in:
Ajay Ramachandran 2021-01-17 12:53:31 -05:00
parent e32a251ef3
commit 7307340afa

View file

@ -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
}
/**