Update menu.py
Browse files
menu.py
CHANGED
@@ -1,23 +1,18 @@
|
|
1 |
from flask import Blueprint, render_template, request, session, jsonify, redirect, url_for
|
2 |
from salesforce import get_salesforce_connection
|
3 |
import os
|
4 |
-
|
5 |
menu_blueprint = Blueprint('menu', _name_)
|
6 |
-
|
7 |
# Initialize Salesforce connection
|
8 |
sf = get_salesforce_connection()
|
9 |
-
|
10 |
# Constants for video handling
|
11 |
STATIC_DIR = os.path.join(os.path.dirname(_file_), 'static')
|
12 |
PLACEHOLDER_VIDEO = 'placeholder.mp4'
|
13 |
PLACEHOLDER_PATH = os.path.join(STATIC_DIR, PLACEHOLDER_VIDEO)
|
14 |
SECTION_ORDER = ["Best Sellers", "Starters", "Biryanis", "Curries", "Breads", "Customized dish", "Apetizer", "Desserts", "Soft Drinks"]
|
15 |
-
|
16 |
# Create placeholder video at startup if it doesn't exist
|
17 |
if not os.path.exists(PLACEHOLDER_PATH):
|
18 |
open(PLACEHOLDER_PATH, 'wb').close()
|
19 |
print(f"Created placeholder video at {PLACEHOLDER_PATH}")
|
20 |
-
|
21 |
def get_valid_video_path(item_name, video_url=None):
|
22 |
"""
|
23 |
Get valid video path for item with placeholder fallback
|
|
|
1 |
from flask import Blueprint, render_template, request, session, jsonify, redirect, url_for
|
2 |
from salesforce import get_salesforce_connection
|
3 |
import os
|
|
|
4 |
menu_blueprint = Blueprint('menu', _name_)
|
|
|
5 |
# Initialize Salesforce connection
|
6 |
sf = get_salesforce_connection()
|
|
|
7 |
# Constants for video handling
|
8 |
STATIC_DIR = os.path.join(os.path.dirname(_file_), 'static')
|
9 |
PLACEHOLDER_VIDEO = 'placeholder.mp4'
|
10 |
PLACEHOLDER_PATH = os.path.join(STATIC_DIR, PLACEHOLDER_VIDEO)
|
11 |
SECTION_ORDER = ["Best Sellers", "Starters", "Biryanis", "Curries", "Breads", "Customized dish", "Apetizer", "Desserts", "Soft Drinks"]
|
|
|
12 |
# Create placeholder video at startup if it doesn't exist
|
13 |
if not os.path.exists(PLACEHOLDER_PATH):
|
14 |
open(PLACEHOLDER_PATH, 'wb').close()
|
15 |
print(f"Created placeholder video at {PLACEHOLDER_PATH}")
|
|
|
16 |
def get_valid_video_path(item_name, video_url=None):
|
17 |
"""
|
18 |
Get valid video path for item with placeholder fallback
|