From 28333ed1bfed23e8b153997469e3a9422609bf8d Mon Sep 17 00:00:00 2001 From: Friedemann Date: Sun, 15 Sep 2024 15:04:53 +0000 Subject: [PATCH] change everything so it converts gpx to fit --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index cc366c5..f551c5a 100644 --- a/app.py +++ b/app.py @@ -8,7 +8,7 @@ app.secret_key = 'your_secret_key_here' # Required for flash messaging INPUT_FOLDER = '/app/input' OUTPUT_FOLDER = '/app/output' -ALLOWED_EXTENSIONS = {'fit'} +ALLOWED_EXTENSIONS = {'gpx'} app.config['INPUT_FOLDER'] = INPUT_FOLDER app.config['OUTPUT_FOLDER'] = OUTPUT_FOLDER @@ -31,15 +31,15 @@ def upload_file(): input_path = os.path.join(app.config['INPUT_FOLDER'], filename) file.save(input_path) - output_filename = f"{os.path.splitext(filename)[0]}.gpx" + output_filename = f"{os.path.splitext(filename)[0]}.fit" output_path = os.path.join(app.config['OUTPUT_FOLDER'], output_filename) - subprocess.run(['gpsbabel', '-i', 'garmin_fit', '-f', input_path, '-o', 'gpx', '-F', output_path]) + subprocess.run(['gpsbabel', '-i', 'gpx', '-f', input_path, '-o', 'garmin_fit', '-F', output_path]) flash('File uploaded and converted successfully', 'success') return redirect(url_for('upload_file')) else: - flash('Invalid file type. Please upload a .fit file.', 'error') + flash('Invalid file type. Please upload a .gpx file.', 'error') return redirect(url_for('upload_file')) input_files = os.listdir(app.config['INPUT_FOLDER'])