Added a significant overhaul to the server manager.

This commit is contained in:
2025-12-29 16:07:30 -05:00
parent 4f4e5276a6
commit 216e18a7b4
796 changed files with 528631 additions and 2671 deletions
+40
View File
@@ -0,0 +1,40 @@
from pydantic_settings import BaseSettings, SettingsConfigDict
import subprocess
import logging
import shutil
logger = logging.getLogger(__name__)
# Configure logging early
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
handlers=[
logging.StreamHandler() # Log to console
]
)
def check_gpu_support():
try:
logger.debug("Checking ffmpeg for CUDA support...")
result = subprocess.run("ffmpeg -hwaccels", shell=True, capture_output=True, text=True, check=True)
if "cuda" in result.stdout:
logger.info("ffmpeg with CUDA support detected. Enabling GPU acceleration.")
return True
except (FileNotFoundError, subprocess.CalledProcessError) as e:
logger.debug(f"GPU detection failed: {e}")
pass
logger.info("No ffmpeg with CUDA support detected. Falling back to CPU-based processing.")
return False
class Settings(BaseSettings):
samba_server_ip: str
samba_username: str
samba_password: str
gpu_enabled: bool = check_gpu_support()
model_config = SettingsConfigDict(env_file=".env")
settings = Settings()