juggling of profiles fix numerical order put in kilncontroller..py :)
label like this 1186 C5 Bisc Std.json
@app.get('/api/profiles')
def get_profiles():
def extract_number(filename):
import re
match = re.search(r'\d+', filename)
return int(match.group()) if match else float('inf')
profile_files = sorted(
[f for f in os.listdir(profile_path) if os.path.isfile(os.path.join(profile_path, f))],
key=extract_number
)
profiles = []
for filename in profile_files:
with open(os.path.join(profile_path, filename), 'r') as f:
profiles.append(json.load(f))
return json.dumps(profiles)