from app import create_app
from app.config import Config
import os

try:
    # Validate FFmpeg paths before creating app
    Config.validate_paths()
    app = create_app()
except Exception as e:
    print(f"Error starting application: {str(e)}")
    raise

if __name__ == '__main__':
    print("Starting Flask app for mobile access (HTTP only)")
    print("Access the app at:")
    print("- From this computer: http://localhost:5003")
    print("- From mobile on same network: http://192.168.234.162:5003")
    print()
    print("Note: This is HTTP (not HTTPS) for mobile compatibility")
    print("Some features requiring HTTPS may not work properly.")
    
    app.run(
        debug=True,
        host='0.0.0.0',
        port=5003,
        # No SSL context for mobile compatibility
    )