Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions custom_components/hacs/repositories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from aiogithubapi import (
AIOGitHubAPIException,
AIOGitHubAPINotModifiedException,
GitHubNotModifiedException,
GitHubReleaseModel,
)
from aiogithubapi.objects.repository import AIOGitHubAPIRepository
Expand Down Expand Up @@ -1010,11 +1010,17 @@ async def async_get_legacy_repository_object(
) -> tuple[AIOGitHubAPIRepository, Any | None]:
"""Return a repository object."""
try:
repository = await self.hacs.github.get_repo(self.data.full_name, etag)
return repository, self.hacs.github.client.last_response.etag
except AIOGitHubAPINotModifiedException as exception:
response = await self.hacs.githubapi.repos.get(
repository=self.data.full_name,
etag=etag,
)
return AIOGitHubAPIRepository(
client=self.hacs.github.client,
attributes=response.data._raw_data,
), response.etag
except GitHubNotModifiedException as exception:
raise HacsNotModifiedException(exception) from exception
except (ValueError, AIOGitHubAPIException, Exception) as exception:
except Exception as exception:
raise HacsException(exception) from exception

def update_filenames(self) -> None:
Expand Down