Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions clefincode_chat/setup/install.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import frappe
import subprocess
import shutil

def ensure_contact_custom_fields():
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
Expand All @@ -17,7 +17,7 @@ def after_install():
ensure_contact_custom_fields()
create_roles()
create_users_profiles()
install_ffmpeg()
check_ffmpeg()
add_default_limited_roles()
# =================================================================================
def create_roles():
Expand Down Expand Up @@ -101,12 +101,9 @@ def create_users_profiles():

frappe.db.commit()
# =================================================================================
def install_ffmpeg():
try:
subprocess.run(["sudo", "apt", "update", "--fix-missing" , "-y",], check=True)
subprocess.run(["sudo", "apt", "install", "ffmpeg", "--fix-missing" , "-y"], check=True)
except subprocess.CalledProcessError as e:
print(f"An error occurred: {e}")
def check_ffmpeg():
if not shutil.which("ffmpeg"):
print("Warning: FFmpeg is not installed. Install it manually to enable audio and video processing.")
# =================================================================================

def add_default_limited_roles():
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deploy.dependencies.apt]
packages = ["ffmpeg"]