From c46a942a00d9445a15895461ae55910da0f3cbd7 Mon Sep 17 00:00:00 2001 From: Gabe Serna Date: Mon, 18 Nov 2024 17:14:53 -0500 Subject: [PATCH] V1.2.1 Update YT Error Handling --- app/BenefitSection.tsx | 2 +- app/audio/AudioForm.tsx | 8 ++++++++ app/layout.tsx | 9 ++++++--- package-lock.json | 2 +- package.json | 2 +- utils/getAudioFromUrl.ts | 5 ++++- utils/infoList.ts | 1 + 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/BenefitSection.tsx b/app/BenefitSection.tsx index 374fd15..196f459 100644 --- a/app/BenefitSection.tsx +++ b/app/BenefitSection.tsx @@ -140,7 +140,7 @@ export default function BenefitSection() {
{isMounted && (

© {new Date().getFullYear()}{" "} - + Songscribe

Created by Gabriel Serna

-

- +

+ GitHub

diff --git a/package-lock.json b/package-lock.json index fa0f79f..1a0a334 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "songscribe", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 8422538..bf111c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "songscribe", - "version": "1.2.0", + "version": "1.2.1", "author": "Gabriel Serna", "private": true, "scripts": { diff --git a/utils/getAudioFromUrl.ts b/utils/getAudioFromUrl.ts index 64832bc..b8fe707 100644 --- a/utils/getAudioFromUrl.ts +++ b/utils/getAudioFromUrl.ts @@ -22,7 +22,10 @@ export default async function getAudioFromURL( if (response) { if (!response.ok) { - throw new Error(`${response.status}`); + const message = await response.json(); + if (message.error.includes("bot")) { + throw new Error("401"); + } else throw new Error(`${response.status}`); } } else throw new Error("0"); diff --git a/utils/infoList.ts b/utils/infoList.ts index cf10a74..df68738 100644 --- a/utils/infoList.ts +++ b/utils/infoList.ts @@ -9,4 +9,5 @@ export const infoList = [ "If you want to remove the MIDI transcription for an instrument that isn't part of the song, set the confidence threshold all the way up and regenerate it.", "To continue working on the transcription, you can download the MIDI file and upload it to your music notation editor of choice.", "If the automatic transcription isn't very accurate, you can download the isolated audio for each instrument and continue to transcribe it yourself.", + "To isolate 30 seconds of audio, expect the process to take around 1 minute or more depending on the amount of instruments.", ];