Skip to content
Open
Changes from 1 commit
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
14 changes: 7 additions & 7 deletions custom_components/hacs/repositories/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from contextlib import suppress
import re
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -99,14 +100,13 @@ async def update_repository(self, ignore_issues=False, force=False):

async def get_package_content(self):
"""Get package content."""
try:
package = await self.repository_object.get_contents("package.json", self.ref)
package = json_loads(package.content)

if package:
with suppress(Exception):
result = await self.hacs.async_download_file(
f"https://raw.githubusercontent.com/{self.data.full_name}/{self.ref}/package.json",
nolog=True,
)
if result is not None and (package := json_loads(result)):
self.data.authors = package["author"]
except BaseException: # lgtm [py/catch-base-exception] pylint: disable=broad-except
pass

def update_filenames(self) -> None:
"""Get the filename to target."""
Expand Down