Skip to content

Commit

Permalink
Remove period from ext in Asset
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Dec 23, 2024
1 parent cc61f6f commit c4d22d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twitchio/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def qualified_name(self) -> str:
If the file extension has not been set, this method returns the same as :attr:`.name`.
"""
name: str = self._name.split(".")[0]
return name + self.ext if self.ext else self._name
return f"{name}{self._ext}" if self._ext else self._name

@property
def ext(self) -> str | None:
Expand All @@ -141,7 +141,7 @@ def ext(self) -> str | None:
See: `:meth:`.fetch_ext` to try and force setting the file extension by content type.
"""
return "." + self._ext.removeprefix(".") if self._ext else None
return self._ext.removeprefix(".") if self._ext else None

@property
def dimensions(self) -> tuple[int, int] | None:
Expand Down Expand Up @@ -341,7 +341,7 @@ async def save(
fp = pathlib.Path(fp) / (self.qualified_name if force_extension else self.name)

elif isinstance(fp, str) and force_extension:
fp = f"{fp}{self.ext or ''}"
fp = f"{fp}{self._ext or ''}"

with open(fp, "wb") as new:
written = new.write(data.read())
Expand Down

0 comments on commit c4d22d2

Please sign in to comment.