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

View File

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

View File

@@ -46,7 +46,7 @@ const ScoreModal = (props: ScoreModalProps) => {
/>
))}
</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' }}>
<Translate translationKey="precision" />
<Text>{props.precision}%</Text>

View File

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