The swiss army knife of lossless video/audio editing
rename segIndex->segColorIndex
Mikael Finstadca58a14397eb
diff --git a/src/App.jsx b/src/App.jsxindex 40d5c392..8b744ec6 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -166,7 +166,7 @@ const App = memo(() => {const createIndexedSegment = useCallback(({ segment, incrementCount } = {}) => {if (incrementCount) segCounterRef.current += 1;- const ret = createSegment({ segIndex: segCounterRef.current, ...segment });+ const ret = createSegment({ segColorIndex: segCounterRef.current, ...segment });return ret;}, []);@@ -379,8 +379,8 @@ const App = memo(() => {errorToast(i18n.t('Make sure you have no overlapping segments.'));return;}- // don't reset segIndex (which represent colors) when inverting- const newInverseCutSegments = inverseCutSegments.map((inverseSegment, segIndex) => createSegment({ ...inverseSegment, segIndex }));+ // don't reset segColorIndex (which represent colors) when inverting+ const newInverseCutSegments = inverseCutSegments.map((inverseSegment, index) => createSegment({ ...inverseSegment, segColorIndex: index }));setCutSegments(newInverseCutSegments);}, [inverseCutSegments, setCutSegments]);diff --git a/src/segments.js b/src/segments.jsindex b34a1845..246cd68f 100644--- a/src/segments.js+++ b/src/segments.js@@ -1,12 +1,12 @@import { v4 as uuidv4 } from 'uuid';import sortBy from 'lodash/sortBy';-export const createSegment = ({ start, end, name, tags, segIndex } = {}) => ({+export const createSegment = ({ start, end, name, tags, segColorIndex } = {}) => ({start,end,name: name || '',segId: uuidv4(),- segIndex,+ segColorIndex,// `tags` is an optional object (key-value). Values must always be string// See https://github.com/mifi/lossless-cut/issues/879diff --git a/src/util/colors.js b/src/util/colors.jsindex 588c4409..2aa95026 100644--- a/src/util/colors.js+++ b/src/util/colors.js@@ -17,7 +17,7 @@ export function getSegColor(seg) {v: 100,});}- const { segIndex } = seg;+ const { segColorIndex } = seg;- return getColor(segIndex);+ return getColor(segColorIndex);}