This commit is contained in:
GitBluub
2024-01-17 23:48:53 +01:00
committed by Clément Le Bihan
parent 2781276c12
commit 69329118f7
4 changed files with 14 additions and 12 deletions

View File

@@ -5,7 +5,6 @@ volumes:
scoro_logs: scoro_logs:
meilisearch: meilisearch:
services: services:
back: back:
#platform: linux/amd64 #platform: linux/amd64
@@ -93,7 +92,7 @@ services:
- "4567:4567" - "4567:4567"
meilisearch: meilisearch:
image: getmeili/meilisearch:v1.4 image: getmeili/meilisearch:v1.5
volumes: volumes:
- meilisearch:/meili_data - meilisearch:/meili_data
env_file: env_file:
@@ -104,4 +103,3 @@ services:
interval: 10s interval: 10s
timeout: 10s timeout: 10s
retries: 5 retries: 5

View File

@@ -35,9 +35,8 @@ const getCursorToPlay = (
return; return;
} }
for (let i = cursorInfos.length - 1; i > currentCurIdx; i--) { for (let i = cursorInfos.length - 1; i > currentCurIdx; i--) {
const cursorInfo = cursorInfos[i]!; if (cursorInfos[i]!.timestamp <= timestamp) {
if (cursorInfo.timestamp <= timestamp) { onCursorMove(cursorInfos[i]!, i);
onCursorMove(cursorInfo, i);
} }
} }
}; };
@@ -186,7 +185,7 @@ const PartitionMagic = ({
}, [data?.cursors, melodySound.current?._loaded]); }, [data?.cursors, melodySound.current?._loaded]);
React.useEffect(() => { React.useEffect(() => {
if (!shouldPlay && playType != 'practice') return; if (!shouldPlay) return;
if (!piano.current || !isPianoLoaded) return; if (!piano.current || !isPianoLoaded) return;
if (!data || data?.cursors.length === 0) return; if (!data || data?.cursors.length === 0) return;
getCursorToPlay( getCursorToPlay(
@@ -194,6 +193,8 @@ const PartitionMagic = ({
currentCurIdx.current, currentCurIdx.current,
timestamp + transitionDuration, timestamp + transitionDuration,
(cursor, idx) => { (cursor, idx) => {
console.log(data.cursors)
console.log("b ", timestamp, cursor, currentCurIdx.current)
currentCurIdx.current = idx; currentCurIdx.current = idx;
partitionOffset.value = withTiming( partitionOffset.value = withTiming(
-(cursor.x - data!.cursors[0]!.x) / partitionDims[0], -(cursor.x - data!.cursors[0]!.x) / partitionDims[0],
@@ -202,7 +203,7 @@ const PartitionMagic = ({
easing: Easing.inOut(Easing.ease), easing: Easing.inOut(Easing.ease),
} }
); );
if (playType == 'practice') return; if (playType === 'practice') return;
cursor.notes.forEach((note) => { cursor.notes.forEach((note) => {
piano.current?.start({ piano.current?.start({
note: note.note, note: note.note,

View File

@@ -46,7 +46,7 @@ const ScoreModal = (props: ScoreModalProps) => {
/> />
))} ))}
</Row> </Row>
<Text fontSize="3xl">{Math.max(score, 0)}%</Text> <Text fontSize="3xl">{Math.max(score, 0).toFixed(2)}%</Text>
<Row w="100%" style={{ justifyContent: 'space-between' }}> <Row w="100%" style={{ justifyContent: 'space-between' }}>
<Translate translationKey="precision" /> <Translate translationKey="precision" />
<Text>{props.precision}%</Text> <Text>{props.precision}%</Text>

View File

@@ -336,7 +336,10 @@ const PlayView = ({ songId }: PlayViewProps) => {
style={{}} style={{}}
type="outlined" type="outlined"
title={translate('practiceBtn')} title={translate('practiceBtn')}
onPress={async () => setPlayType('practice')} onPress={async () => {
setPlayType('practice');
setShouldPlay(true);
}}
/> />
<ButtonBase <ButtonBase
style={{}} style={{}}