Browse Source

Support cover images

master
venkataakhil 1 year ago
parent
commit
479b7451ae
  1. 22
      smart_service/apis/support.py

22
smart_service/apis/support.py

@ -220,10 +220,13 @@ def change_file_dir():
else:
return "Done"
@frappe.whitelist(allow_guest=1)
def file_not_exists():
# file_data = frappe.db.sql(
# '''select parent,step_name,file,name from tabProcedure_Details where content_type = 'File' order by parent;''', as_dict=1)
""" Cover Images """
file_data = frappe.db.sql(
'''select parent,step_name,file,name from tabProcedure_Details where content_type = 'File' order by parent;''', as_dict=1)
'''selectparent,systems,sub_systems,cover_image from `tabSystem Mapping_Sub System` where order by parent;''', as_dict=1)
changed_file_list = []
count = 1
@ -238,7 +241,7 @@ def file_not_exists():
changed_file_list.append(d)
count += 1
file_path_not_exists = base_path + "/files/json_files/1.json"
file_path_not_exists = base_path + "/files/json_files/cover_missing.json"
with open(file_path_not_exists, 'w') as outfile:
try:
outfile.write(json.dumps(changed_file_list))
@ -246,6 +249,19 @@ def file_not_exists():
pass
@frappe.whitelist(allow_guest=1)
def get_mp4_cover():
file_data = frappe.db.sql(
'''select parent,systems,sub_systems,cover_image from `tabSystem Mapping_Sub System` where cover_image like '.mp4' order by parent;''', as_dict=1)
file_path_not_exists = base_path + "/files/json_files/cover_mp4.json"
with open(file_path_not_exists, 'w') as outfile:
try:
outfile.write(json.dumps(file_data))
except Exception as e:
pass
def remove_extra_spaces_in_file_path():
import re
file_path_not_exists = base_path + "/files/json_files/1.json"

Loading…
Cancel
Save