code cleanup
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user