code cleanup

This commit is contained in:
Joel Mathew Thomas
2025-03-20 19:14:13 +05:30
parent 11a1ff635a
commit 1e44b4c7de
6 changed files with 3 additions and 19 deletions
+1 -4
View File
@@ -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")
-1
View File
@@ -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