diff options
| author | salmonik <raisersoft@proton.me> | 2026-02-20 19:08:00 +0100 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-02-20 19:08:00 +0100 |
| commit | b193662b6d94cb90795366289f044b3411e03ef8 (patch) | |
| tree | c15994472f9f568b330e8fcff92038d0bd0ef64f /cogs | |
| parent | fix settings file nagging again (diff) | |
| download | senator-sperma-b193662b6d94cb90795366289f044b3411e03ef8.tar.gz senator-sperma-b193662b6d94cb90795366289f044b3411e03ef8.zip | |
fix settings file nagging again again
Diffstat (limited to 'cogs')
| -rw-r--r-- | cogs/music/search_utils.py | 3 | ||||
| -rw-r--r-- | cogs/tts.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/cogs/music/search_utils.py b/cogs/music/search_utils.py index 50d229c..bc9e335 100644 --- a/cogs/music/search_utils.py +++ b/cogs/music/search_utils.py | |||
| @@ -242,7 +242,8 @@ class AudioSearcher: | |||
| 242 | 242 | ||
| 243 | try: | 243 | try: |
| 244 | async with aiofiles.open('settings.json') as f: | 244 | async with aiofiles.open('settings.json') as f: |
| 245 | data = json.load(f) | 245 | content = await f.read() |
| 246 | data = json.loads(content) | ||
| 246 | search_paths = data.get('audio_paths', []) | 247 | search_paths = data.get('audio_paths', []) |
| 247 | logger.info(f"Searching in paths: {search_paths}") | 248 | logger.info(f"Searching in paths: {search_paths}") |
| 248 | 249 | ||
diff --git a/cogs/tts.py b/cogs/tts.py index 158006c..44a976f 100644 --- a/cogs/tts.py +++ b/cogs/tts.py | |||
| @@ -24,7 +24,8 @@ class TTS(commands.Cog): | |||
| 24 | if os.path.exists('settings.json'): | 24 | if os.path.exists('settings.json'): |
| 25 | try: | 25 | try: |
| 26 | async with aiofiles.open('settings.json') as f: | 26 | async with aiofiles.open('settings.json') as f: |
| 27 | data = json.load(f) | 27 | content = await f.read() |
| 28 | data = json.loads(content) | ||
| 28 | volume = data.get('volume', 1.0) | 29 | volume = data.get('volume', 1.0) |
| 29 | except (json.JSONDecodeError, KeyError) as e: | 30 | except (json.JSONDecodeError, KeyError) as e: |
| 30 | logger.error(f"Error loading settings: {e}") | 31 | logger.error(f"Error loading settings: {e}") |
