diff --git a/api/api/consumers.py b/api/api/consumers.py index b53ebca..3d1d5a1 100644 --- a/api/api/consumers.py +++ b/api/api/consumers.py @@ -12,7 +12,7 @@ class MediaConsumer(WebsocketConsumer): self.accept() self.file_uuid = [] # List to store file uuids self.send(text_data=json.dumps({ - "message": "Connected to WebSocket server!" + "response": "Pong!" })) def receive(self, text_data): @@ -23,15 +23,12 @@ class MediaConsumer(WebsocketConsumer): if "file_uuid" in data: uuid = data["file_uuid"] self.file_uuid.append(uuid) - self.send(text_data=json.dumps({"response": f"UUID {uuid} stored."})) elif message == "ping": self.send(text_data=json.dumps({"response": "pong"})) else: self.send(text_data=json.dumps({"response": f"Received: {message}"})) def disconnect(self, close_code): - print("Disconnected from Websocket") - print("Stored file UUIDs:", self.file_uuid) for file_uuid in self.file_uuid: dir_path = os.path.join(UPLOAD_DIR, file_uuid); zip_path = os.path.join(UPLOAD_DIR, f"{file_uuid}.zip") diff --git a/api/api/tasks.py b/api/api/tasks.py index 6043223..39fc649 100644 --- a/api/api/tasks.py +++ b/api/api/tasks.py @@ -73,7 +73,6 @@ def resample_audio_task(file_path, sr): def music_separation_task(file_path): """Celery task to separate music audio into sources""" file_path = Path(file_path) - print("File path is ", file_path) # Determine the base directory (output path) output_path = file_path.parent diff --git a/client/src/Pages/ProcessingPage.tsx b/client/src/Pages/ProcessingPage.tsx index e68644f..d5a6e7e 100644 --- a/client/src/Pages/ProcessingPage.tsx +++ b/client/src/Pages/ProcessingPage.tsx @@ -56,7 +56,6 @@ function ProcessingPage() { }); if (res.status === 200) { - console.log("Download successful"); await handleDownload(res.data); } else { console.log("Failed to download the file"); @@ -79,7 +78,6 @@ function ProcessingPage() { setLogs((prevLogs) => [...prevLogs, formatLogMessage(`freqsplit/postprocessing: Downloading file`)]); }, 100); if (res.status === 200) { - console.log("Download successful"); const blob = new Blob([res.data], { type: "audio/wav" }); const fileURL = URL.createObjectURL(blob); @@ -165,7 +163,6 @@ function ProcessingPage() { fileURLs.push({ name: filename, url: fileURL, spectrogram: res.data.spectrogram, spec_sr: res.data.spec_sr }); } } - console.log(fileURLs) setExtractedFiles(fileURLs); setProgress(100); }; @@ -176,7 +173,6 @@ function ProcessingPage() { return; } - console.log("Starting processing..."); processStep("/api/normalize", formatLogMessage("freqsplit/preprocessing: Applying amplitude scaling"), () => { processStep("/api/trim", formatLogMessage("freqsplit/preprocessing: Pruning silent segments from audio"), () => { diff --git a/client/src/Pages/ResultsPage.tsx b/client/src/Pages/ResultsPage.tsx index 698c1ca..d5e5fa1 100644 --- a/client/src/Pages/ResultsPage.tsx +++ b/client/src/Pages/ResultsPage.tsx @@ -26,8 +26,6 @@ import { formatLogMessage } from "../utils/logUtils"; function ResultsPage() { const navigate = useNavigate(); const { mediaFile, response, extractedFiles, downloadedFileURL, downloadedFileSpectrogram, setLogs } = useMediaContext(); - console.log("Extracted files are", extractedFiles); -// const [isPlaying, setIsPlaying] = useState(false); const audioClass = response.audio_class const isVideo = mediaFile?.type.includes('video'); diff --git a/client/src/Pages/UploadPage.tsx b/client/src/Pages/UploadPage.tsx index a1243d4..9725903 100644 --- a/client/src/Pages/UploadPage.tsx +++ b/client/src/Pages/UploadPage.tsx @@ -24,7 +24,7 @@ function UploadPage() { const navigate = useNavigate(); const theme = useTheme(); const { socket, isConnected } = useWebSocket(); - const { setMediaFile, setResponse, response, setLogs } = useMediaContext(); + const { setMediaFile, setResponse, setLogs } = useMediaContext(); const [file, setFile] = useState(null); const [isDragging, setIsDragging] = useState(false); const [fileError, setFileError] = useState(""); @@ -158,8 +158,6 @@ function UploadPage() { }, }); - console.log("Upload response:", res); - if (res.status === 201 && res.data) { setResponse( ({ audio_class: res.data.audio_class, @@ -184,9 +182,6 @@ function UploadPage() { } }; - useEffect(() => { - console.log("Updated response:", response); - }, [response]); return ( diff --git a/client/src/contexts/WebSocketContext.tsx b/client/src/contexts/WebSocketContext.tsx index eaca89c..92d52fe 100644 --- a/client/src/contexts/WebSocketContext.tsx +++ b/client/src/contexts/WebSocketContext.tsx @@ -20,7 +20,6 @@ export const WebSocketProvider: React.FC<{ children: React.ReactNode }> = ({ chi const newSocket = new WebSocket(WEBSOCKET_URL); newSocket.onopen = () => { - console.log("Connected to WebSocket!"); setIsConnected(true); }; @@ -34,7 +33,7 @@ export const WebSocketProvider: React.FC<{ children: React.ReactNode }> = ({ chi }; newSocket.onmessage = (event) => { - console.log("Message from server:", event.data); + console.log("ws/freqsplit: ", JSON.parse(event.data).response); }; setSocket(newSocket);