commit a4c770217e7b2b89610dc37be7ec91fc59592bb0 Author: George Date: Tue Jul 7 11:24:23 2026 +0530 feat: --Wroking ! diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dfba59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +venv/ + +# docker-compose.yml + +# Python cache +__pycache__/ +*.pyc + + +# IDE files +.vscode/ +.idea/ \ No newline at end of file diff --git a/experimental.py b/experimental.py new file mode 100644 index 0000000..e69de29 diff --git a/nas_schedular_service.py b/nas_schedular_service.py new file mode 100644 index 0000000..a42224d --- /dev/null +++ b/nas_schedular_service.py @@ -0,0 +1,32 @@ + +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware +from pydantic import BaseModel +from typing import Optional +app = FastAPI() + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_methods=["*"], + allow_headers=["*"], +) + + +class AudioExportConfig(BaseModel): + audio_format: Optional[str] = None + nas_push_timing: Optional[str] = None + +@app.post("/audio-export-settings") +def audio_export_settings(config: AudioExportConfig): + print(f"\n[+] Audio export settings received:") + print(f" audio_format : {config.audio_format}") + print(f" nas_push_timing : {config.nas_push_timing}") + return { + "status": "success", + "message": "Audio export settings received.", + "settings": { + "audio_format": config.audio_format, + "nas_push_timing": config.nas_push_timing + } + } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d4544e7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi==0.137.2 +uvicorn==0.49.0 diff --git a/samba.py b/samba.py new file mode 100644 index 0000000..30dddde --- /dev/null +++ b/samba.py @@ -0,0 +1,31 @@ +import subprocess +import os +SAMBA_SERVER = "172.16.10.144" +# SAMBA_SHARE = "wav_files" +SAMBA_SHARE = "desktop" +LOCAL_FILE = "test.wav" +DOCKER_VOLUME_PATH = "/var/lib/docker/volumes/pymumble_data/_data" +def push(LOCAL_FILE): + cmd = [ + "smbclient", + f"//{SAMBA_SERVER}/{SAMBA_SHARE}", + "-N", # no password + "-c", f"put {LOCAL_FILE}" + ] + result = subprocess.run(cmd, capture_output=True, text=True) + + print(result.stdout) + print(result.stderr) + if result.returncode == 0: + print("[✓] Pushed successfully") + os.remove(LOCAL_FILE) + print(f"[✓] Deleted local file: {LOCAL_FILE}") + else: + print("[!] Push failed") + + + + + + +push(LOCAL_FILE) \ No newline at end of file diff --git a/test.wav b/test.wav new file mode 100644 index 0000000..4069095 Binary files /dev/null and b/test.wav differ