Skip to content

Commit

Permalink
Ignore ETag for updates of installed repositories (#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Feb 10, 2021
1 parent 08f76e6 commit c682bd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion custom_components/hacs/helpers/classes/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ async def common_update(self, ignore_issues=False, force=False):
# Attach repository
current_etag = self.data.etag_repository
await common_update_data(self, ignore_issues, force)
if (current_etag == self.data.etag_repository) and not force:
if (
not self.data.installed
and (current_etag == self.data.etag_repository)
and not force
):
self.logger.debug(
"Did not update %s, content was not modified", self.data.full_name
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ async def common_update_data(repository, ignore_issues=False, force=False):
hacs.session,
hacs.configuration.token,
repository.data.full_name,
etag=None if force else repository.data.etag_repository,
etag=None
if force or repository.data.installed
else repository.data.etag_repository,
)
repository.repository_object = repository_object
repository.data.update_data(repository_object.attributes)
Expand Down

0 comments on commit c682bd6

Please sign in to comment.