Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions BeatPrints/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def _get_track_metadata(self, track: dict) -> TrackMetadata:
"duration": self._format_duration(track["duration_ms"]),
"image": track["album"]["images"][0]["url"],
"label": (
album["label"]
if len(album["label"]) < 35
album.get("label", "")
if len(album.get("label", "")) < 35
else track["artists"][0]["name"]
),
"id": track["id"],
Expand Down Expand Up @@ -166,8 +166,8 @@ def _get_album_metadata(self, album: dict, shuffle: bool) -> AlbumMetadata:
),
"image": album["images"][0]["url"],
"label": (
album["label"]
if len(album["label"]) < 35
album.get("label", "")
if len(album.get("label", "")) < 35
else album["artists"][0]["name"]
),
"id": album["id"],
Expand Down
2 changes: 2 additions & 0 deletions BeatPrints/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def group_by_font(text: str, fonts: Dict[str, TTFont]) -> List[List[str]]:
groups.append([char, last_font_path])

# Merge consecutive characters that use the same font into one group.
if not groups:
return []
merged = [groups[0]]
for char, font_path in groups[1:]:
# Append the character to the current group.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ questionary = "*"
rich = "*"
toml = "*"
spotipy = "*"
typing-extensions = "*"

[tool.poetry.scripts]
beatprints = 'cli.prompt:main'
Expand Down