From d2713059b3274e1a04639201c6ac1654adf088d6 Mon Sep 17 00:00:00 2001 From: Shane Israel Date: Wed, 8 Apr 2026 17:41:50 -0600 Subject: [PATCH 1/4] fix an issue where restarting the app would overrwrite config values --- app/server/fireshare/__init__.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/server/fireshare/__init__.py b/app/server/fireshare/__init__.py index 74f59196..91f23413 100644 --- a/app/server/fireshare/__init__.py +++ b/app/server/fireshare/__init__.py @@ -275,20 +275,21 @@ def load_user(user_id): if 'integrations' not in DEFAULT_CONFIG: DEFAULT_CONFIG['integrations'] = {} - DEFAULT_CONFIG['integrations']['discord_webhook_url'] = app.config.get('DISCORD_WEBHOOK_URL', '') - DEFAULT_CONFIG['integrations']['generic_webhook_url'] = app.config.get('GENERIC_WEBHOOK_URL', '') - DEFAULT_CONFIG['integrations']['generic_webhook_payload'] = app.config.get('GENERIC_WEBHOOK_PAYLOAD', {}) - update_config(paths['data'] / 'config.json') + # Only overwrite integration settings in config.json if the env vars are explicitly set. + # This preserves values the user may have configured via the UI or directly in config.json. config_path = paths['data'] / 'config.json' with open(config_path, 'r+') as f: data = json.load(f) - - data['integrations']['discord_webhook_url'] = app.config.get('DISCORD_WEBHOOK_URL', '') - data['integrations']['generic_webhook_url'] = app.config.get('GENERIC_WEBHOOK_URL', '') - data['integrations']['generic_webhook_payload'] = app.config.get('GENERIC_WEBHOOK_PAYLOAD', {}) - + + if app.config.get('DISCORD_WEBHOOK_URL'): + data['integrations']['discord_webhook_url'] = app.config['DISCORD_WEBHOOK_URL'] + if app.config.get('GENERIC_WEBHOOK_URL'): + data['integrations']['generic_webhook_url'] = app.config['GENERIC_WEBHOOK_URL'] + if app.config.get('GENERIC_WEBHOOK_PAYLOAD'): + data['integrations']['generic_webhook_payload'] = app.config['GENERIC_WEBHOOK_PAYLOAD'] + f.seek(0) json.dump(data, f, indent=2) f.truncate() From 4935d205b607fcb512cd5bc3f1b87aefbc072cc9 Mon Sep 17 00:00:00 2001 From: Shane Israel Date: Wed, 8 Apr 2026 18:13:01 -0600 Subject: [PATCH 2/4] broke up the api.py file into more managable files --- app/client/src/views/Tags.js | 3 +- app/server/fireshare/api.py | 3458 ----------------------- app/server/fireshare/api/__init__.py | 9 + app/server/fireshare/api/admin.py | 715 +++++ app/server/fireshare/api/game.py | 537 ++++ app/server/fireshare/api/helpers.py | 100 + app/server/fireshare/api/misc.py | 258 ++ app/server/fireshare/api/scan.py | 476 ++++ app/server/fireshare/api/tag.py | 274 ++ app/server/fireshare/api/transcoding.py | 220 ++ app/server/fireshare/api/upload.py | 368 +++ app/server/fireshare/api/video.py | 676 +++++ app/server/fireshare/auth.py | 2 +- 13 files changed, 3635 insertions(+), 3461 deletions(-) delete mode 100644 app/server/fireshare/api.py create mode 100644 app/server/fireshare/api/__init__.py create mode 100644 app/server/fireshare/api/admin.py create mode 100644 app/server/fireshare/api/game.py create mode 100644 app/server/fireshare/api/helpers.py create mode 100644 app/server/fireshare/api/misc.py create mode 100644 app/server/fireshare/api/scan.py create mode 100644 app/server/fireshare/api/tag.py create mode 100644 app/server/fireshare/api/transcoding.py create mode 100644 app/server/fireshare/api/upload.py create mode 100644 app/server/fireshare/api/video.py diff --git a/app/client/src/views/Tags.js b/app/client/src/views/Tags.js index 1d610777..4c7394fc 100644 --- a/app/client/src/views/Tags.js +++ b/app/client/src/views/Tags.js @@ -507,9 +507,9 @@ const Tags = ({ authenticated, searchText }) => { open={newTagDialogOpen} onClose={() => { setNewTagDialogOpen(false) - setEditingTag(null) setColorPickerAnchorEl(null) }} + TransitionProps={{ onExited: () => setEditingTag(null) }} PaperProps={{ sx: dialogPaperSx }} > {editingTag ? 'Edit Tag' : 'Create New Tag'} @@ -566,7 +566,6 @@ const Tags = ({ authenticated, searchText }) => {