diff --git a/custom_components/hacs/base.py b/custom_components/hacs/base.py index 96ff6a58094..38f5549dd90 100644 --- a/custom_components/hacs/base.py +++ b/custom_components/hacs/base.py @@ -26,6 +26,7 @@ class HacsCommon: default: List = [] installed: List = [] renamed_repositories = {} + archived_repositories = [] skip: List = [] diff --git a/custom_components/hacs/hacsbase/data.py b/custom_components/hacs/hacsbase/data.py index ea49a7c2101..7548405b93b 100644 --- a/custom_components/hacs/hacsbase/data.py +++ b/custom_components/hacs/hacsbase/data.py @@ -48,13 +48,6 @@ async def async_write(self): self.logger.debug("Saving data") - # Renamed repositories - await async_save_to_store( - self.hacs.hass, - "renamed_repositories", - self.hacs.common.renamed_repositories, - ) - # Hacs await async_save_to_store( self.hacs.hass, @@ -63,6 +56,8 @@ async def async_write(self): "view": self.hacs.configuration.frontend_mode, "compact": self.hacs.configuration.frontend_compact, "onboarding_done": self.hacs.configuration.onboarding_done, + "archived_repositories": self.hacs.common.archived_repositories, + "renamed_repositories": self.hacs.common.renamed_repositories, }, ) await self._async_store_content_and_repos() @@ -127,9 +122,6 @@ async def restore(self): """Restore saved data.""" hacs = await async_load_from_store(self.hacs.hass, "hacs") repositories = await async_load_from_store(self.hacs.hass, "repositories") or {} - self.hacs.common.renamed_repositories = ( - await async_load_from_store(self.hacs.hass, "renamed_repositories") or {} - ) if not hacs and not repositories: # Assume new install @@ -142,6 +134,8 @@ async def restore(self): self.hacs.configuration.frontend_mode = hacs.get("view", "Grid") self.hacs.configuration.frontend_compact = hacs.get("compact", False) self.hacs.configuration.onboarding_done = hacs.get("onboarding_done", False) + self.hacs.common.archived_repositories = hacs.get("archived_repositories", []) + self.hacs.common.renamed_repositories = hacs.get("renamed_repositories", {}) # Repositories hass = self.hacs.hass diff --git a/custom_components/hacs/hacsbase/hacs.py b/custom_components/hacs/hacsbase/hacs.py index 80d47201ebb..7e211324afa 100644 --- a/custom_components/hacs/hacsbase/hacs.py +++ b/custom_components/hacs/hacsbase/hacs.py @@ -61,6 +61,7 @@ class HacsCommon: default = [] installed = [] renamed_repositories = {} + archived_repositories = [] skip = [] @@ -393,6 +394,8 @@ async def async_get_category_repositories(self, category: HacsCategory): repo = self.common.renamed_repositories[repo] if is_removed(repo): continue + if repo in self.common.archived_repositories: + continue repository = self.get_by_name(repo) if repository is not None: if str(repository.data.id) not in self.common.default: diff --git a/custom_components/hacs/helpers/functions/validate_repository.py b/custom_components/hacs/helpers/functions/validate_repository.py index ccf3343d4e7..d695efe2556 100644 --- a/custom_components/hacs/helpers/functions/validate_repository.py +++ b/custom_components/hacs/helpers/functions/validate_repository.py @@ -76,6 +76,7 @@ async def common_update_data( # Make sure the repository is not archived. if repository.data.archived and not ignore_issues: repository.validate.errors.append("Repository is archived.") + hacs.common.archived_repositories.append(repository.data.full_name) raise HacsRepositoryArchivedException("Repository is archived.") # Make sure the repository is not in the blacklist.