diff --git a/README.md b/README.md index a3f60ae0e..a91964bb6 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,15 @@ [![Twitter](https://img.shields.io/twitter/follow/DrakkarsOctobot.svg?label=twitter&style=social)](https://octobot.click/gh-twitter) [![YouTube](https://img.shields.io/youtube/channel/views/UC2YAaBeWY8y_Olqs79b_X8A?label=youtube&style=social)](https://octobot.click/gh-youtube) +## 🎉 OctoBot is launching on Product Hunt on July 10th + +
++ 👆 Follow the launch to get your exclusive discount! +
+diff --git a/octobot/commands.py b/octobot/commands.py index 4040f18b8..8b3096266 100644 --- a/octobot/commands.py +++ b/octobot/commands.py @@ -134,7 +134,6 @@ async def update_or_repair_tentacles_if_necessary(community_auth, selected_profi elif force_refresh_tentacles_setup_config: community_tentacles_packages.refresh_tentacles_setup_config() - # await install_or_update_tentacles(config, additional_tentacles_package_urls) #TMPPP if local_profile_tentacles_setup_config is None or \ not tentacles_manager_api.are_tentacles_up_to_date(local_profile_tentacles_setup_config, constants.VERSION): logger.info("OctoBot tentacles are not up to date. Updating tentacles...") @@ -175,11 +174,14 @@ async def install_all_tentacles( async with aiohttp_util.ssl_fallback_aiohttp_client_session( commons_constants.KNOWN_POTENTIALLY_SSL_FAILED_REQUIRED_URL ) as aiohttp_session: - base_urls = [tentacles_url] + ( - constants.ADDITIONAL_TENTACLES_PACKAGE_URL.split(constants.URL_SEPARATOR) - if constants.ADDITIONAL_TENTACLES_PACKAGE_URL else [] - ) - for url in (base_urls if not only_additional else []) + (additional_tentacles_package_urls or []): + base_urls = [tentacles_url] + community_tentacles_packages.get_env_variable_tentacles_urls() + # avoid duplicates + additional_urls = [ + url + for url in (additional_tentacles_package_urls or []) + if url not in base_urls + ] + for url in (base_urls if not only_additional else []) + additional_urls: if url is None: continue hide_url = url in additional_tentacles_package_urls diff --git a/octobot/community/authentication.py b/octobot/community/authentication.py index 6209f201a..6b8d764f3 100644 --- a/octobot/community/authentication.py +++ b/octobot/community/authentication.py @@ -506,8 +506,9 @@ async def _init_community_data(self, fetch_private_data): self.update_supports(), self.init_public_data(), ] - if fetch_private_data: + if constants.IS_CLOUD_ENV or fetch_private_data: coros.append(self.update_selected_bot()) + if fetch_private_data: coros.append(self.fetch_private_data()) if not self.user_account.is_hosting_enabled(): coros.append(self.update_is_hosting_enabled(True)) diff --git a/octobot/community/tentacles_packages.py b/octobot/community/tentacles_packages.py index a9da2d45d..0fa9258ce 100644 --- a/octobot/community/tentacles_packages.py +++ b/octobot/community/tentacles_packages.py @@ -56,6 +56,12 @@ def get_to_install_and_remove_tentacles( adapt_url_to_bot_version(package_url) for package_url in community_auth.get_saved_package_urls() ] if community_auth.is_logged_in() else [] + to_keep_tentacles = set( + additional_tentacles_package_urls + [ + adapt_url_to_bot_version(package_url) + for package_url in get_env_variable_tentacles_urls() + ] + get_env_variable_tentacles_urls() + ) was_connected_with_remote_packages = community_auth.was_connected_with_remote_packages() # do not remove tentacles: @@ -72,7 +78,7 @@ def get_to_install_and_remove_tentacles( to_remove_urls = [ package_url for package_url in installed_community_package_urls - if package_url not in additional_tentacles_package_urls + if package_url not in to_keep_tentacles ] if can_remove_tentacles else [] if to_remove_urls: tentacles_manager_api.reload_tentacle_info() @@ -98,6 +104,11 @@ def get_to_install_and_remove_tentacles( return list(set(to_install_urls)), list(set(to_remove_tentacles)), force_refresh_tentacles_setup_config +def get_env_variable_tentacles_urls() -> list[str]: + return constants.ADDITIONAL_TENTACLES_PACKAGE_URL.split(constants.URL_SEPARATOR) \ + if constants.ADDITIONAL_TENTACLES_PACKAGE_URL else [] + + def is_community_tentacle_url(url: str) -> bool: return constants.COMMUNITY_EXTENSIONS_PACKAGES_IDENTIFIER in url