Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
fix: preset directory issues (#494)
Browse files Browse the repository at this point in the history
Written on github's editor, and not tested yet 😅 !
  • Loading branch information
daudix authored Sep 23, 2022
2 parents f3588c7 + 8a3fa04 commit 67e9ba9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions gradience/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def reload_user_defined_presets(self):
buglog("file")
# keep compatiblity with old presets
if repo.name.endswith(".json"):
if not os.path.isdir(os.path.join(PRESET_DIR, "user")):
os.mkdir(os.path.join(PRESET_DIR, "user"))

os.rename(repo, os.path.join(
PRESET_DIR, "user", repo.name))

Expand Down
11 changes: 5 additions & 6 deletions gradience/presets_manager_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ class GradiencePresetWindow(Adw.Window):
custom_presets = {}

official_repositories = {
_(
"Official"
): "https://github.com/GradienceTeam/Community/raw/next/official.json",
_(
"Curated"
): "https://github.com/GradienceTeam/Community/raw/next/curated.json",
"Official": "https://github.com/GradienceTeam/Community/raw/next/official.json",
"Curated": "https://github.com/GradienceTeam/Community/raw/next/curated.json",
}

search_results_list = []
Expand Down Expand Up @@ -343,6 +339,9 @@ def reload_pref_group(self):
buglog("file")
# keep compatiblity with old presets
if repo.name.endswith(".json"):
if not os.path.isdir(os.path.join(preset_directory, "user")):
os.mkdir(os.path.join(preset_directory, "user"))

os.rename(repo, os.path.join(
preset_directory, "user", repo.name))

Expand Down

0 comments on commit 67e9ba9

Please sign in to comment.