Better approach for detemining the correct configuration folder for Linux and MacOS, using platformdirs

This commit is contained in:
Deniz Şafak
2025-05-03 18:31:45 +03:00
parent b02416e068
commit 0863b25d82
3 changed files with 5 additions and 11 deletions
+1 -6
View File
@@ -1,6 +1 @@
- Merge pull request [#7](https://github.com/denizsafak/abogen/pull/7) by [@jborza](https://github.com/jborza) that improves voice preview and documentation.
- Fixed the issue when a voice is selected, the voice mixer tries to pre-select that voice and ignores existing profiles.
- Fixed the error while renaming the default "New profile" in the voice mixer.
- Fixed subtitle_combo enabling/disabling when a voice in the voice mixer is selected.
- Prevented using special characters in the profile name to avoid conflicts.
- Improved invalid profile handling in the voice mixer.
- Better approach for detemining the correct configuration folder for Linux and MacOS, using platformdirs.
+3 -4
View File
@@ -66,10 +66,9 @@ def get_version():
# Define config path
def get_user_config_path():
if os.name == "nt":
config_dir = os.path.join(os.environ["APPDATA"], "abogen")
else:
config_dir = os.path.join(os.path.expanduser("~"), ".config", "abogen")
from platformdirs import user_config_dir
# Use platformdirs to get the user configuration directory
config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
os.makedirs(config_dir, exist_ok=True)
return os.path.join(config_dir, "config.json")
+1 -1
View File
@@ -1,6 +1,6 @@
import os
import json
from utils import get_user_config_path, get_resource_path
from utils import get_user_config_path
def _get_profiles_path():