-
Notifications
You must be signed in to change notification settings - Fork 18
Switch from catalog to index download #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -75,10 +75,12 @@ def run(self): | |||||||||||||||||||||||||||||||||
| self._get_custom_addons() | ||||||||||||||||||||||||||||||||||
| self.progress_made.emit("Custom addons loaded", 5, 100) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| addon_cache = self.get_cache("addon_catalog") | ||||||||||||||||||||||||||||||||||
| CreateAddonListWorker.migrate_catalog_to_index() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| addon_cache = self.get_cache("addon_index") | ||||||||||||||||||||||||||||||||||
| if addon_cache: | ||||||||||||||||||||||||||||||||||
| self.process_addon_cache(addon_cache) | ||||||||||||||||||||||||||||||||||
| self.progress_made.emit("Addon catalog loaded", 20, 100) | ||||||||||||||||||||||||||||||||||
| self.progress_made.emit("Addon index loaded", 20, 100) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| macro_cache = self.get_cache("macro") | ||||||||||||||||||||||||||||||||||
| if macro_cache: | ||||||||||||||||||||||||||||||||||
|
|
@@ -90,6 +92,15 @@ def run(self): | |||||||||||||||||||||||||||||||||
| fci.Console.PrintError(str(e) + "\n") | ||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| @staticmethod | ||||||||||||||||||||||||||||||||||
| def migrate_catalog_to_index(): | ||||||||||||||||||||||||||||||||||
| old_catalog_url = fci.Preferences().get("addon_catalog_cache_url") | ||||||||||||||||||||||||||||||||||
| if old_catalog_url.startswith("obsolete"): | ||||||||||||||||||||||||||||||||||
| return # Nothing to migrate, it was never set to anything else | ||||||||||||||||||||||||||||||||||
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | ||||||||||||||||||||||||||||||||||
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | ||||||||||||||||||||||||||||||||||
| fci.Preferences().set("addon_index_cache_url", old_catalog_url) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+97
to
+103
|
||||||||||||||||||||||||||||||||||
| old_catalog_url = fci.Preferences().get("addon_catalog_cache_url") | |
| if old_catalog_url.startswith("obsolete"): | |
| return # Nothing to migrate, it was never set to anything else | |
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | |
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | |
| fci.Preferences().set("addon_index_cache_url", old_catalog_url) | |
| prefs = fci.Preferences() | |
| old_catalog_url = prefs.get("addon_catalog_cache_url") | |
| if not old_catalog_url or old_catalog_url.startswith("obsolete"): | |
| return # Nothing to migrate, it was never set to anything else or was already migrated | |
| fci.Console.PrintWarning("Custom catalog URL was detected: using as the index URL now\n") | |
| fci.Console.PrintWarning(f"URL: {old_catalog_url}\n") | |
| prefs.set("addon_index_cache_url", old_catalog_url) | |
| # Mark the old key as obsolete so this migration only runs once and does not | |
| # overwrite any future user configuration of addon_index_cache_url. | |
| prefs.set("addon_catalog_cache_url", f"obsolete:{old_catalog_url}") |
Uh oh!
There was an error while loading. Please reload this page.