always convert tags to string

fixes #879
pull/978/head
Mikael Finstad 5 years ago
parent 56cc72121a
commit 384d3ca697
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -9,7 +9,12 @@ export const createSegment = ({ start, end, name, tags } = {}) => ({
name: name || '',
color: generateColor(),
segId: uuidv4(),
tags, // tags is an optional object (key-value)
// `tags` is an optional object (key-value). Values must always be string
// See https://github.com/mifi/lossless-cut/issues/879
tags: tags != null && typeof tags === 'object'
? Object.fromEntries(Object.entries(tags).map(([key, value]) => [key, String(value)]))
: undefined,
});
export const createInitialCutSegments = () => [createSegment()];

Loading…
Cancel
Save