Skip to content

Comments

Fix: missing typing-extensions dependency and handle missing API fields while using CLI#57

Open
imyimang wants to merge 3 commits intoTrueMyst:mainfrom
imyimang:main
Open

Fix: missing typing-extensions dependency and handle missing API fields while using CLI#57
imyimang wants to merge 3 commits intoTrueMyst:mainfrom
imyimang:main

Conversation

@imyimang
Copy link

  1. Fix ModuleNotFoundError for typing-extensions
螢幕快照 2026-02-12 15-05-55 Added `typing-extensions` to the dependencies in `pyproject.toml`. This resolves a `ModuleNotFoundError` encountered when installing via `pipx` or in isolated environments where `Pylette`'s dependencies aren't fully propagated.
  1. Fix KeyError: 'label' in spotify.py
    The application currently assumes that the Spotify API always returns a label field in the album metadata. However, when fetching tracks or certain simplified album objects, this field may be missing from the JSON response
{
    "album_type": "album",
    "total_tracks": 11,
    "external_urls": {
        "spotify": "https://open.spotify.com/album/3RBULTZJ97bvVzZLpxcB0j"
    },
    "id": "3RBULTZJ97bvVzZLpxcB0j",
    "images": [...],
    "name": "The Mountain",
    "release_date": "2013-09-17",
    "release_date_precision": "day",
    "type": "album",
    "uri": "spotify:album:3RBULTZJ97bvVzZLpxcB0j",
    "artists": [...],
    "tracks": {...},
    "copyrights": [...],
    "genres": []
    // No "label" field present
}
螢幕快照 2026-02-12 15-13-14

Changes:

  • Replaced direct key access album["label"] with album.get("label", "") to provide a safe fallback.

After Fix:
螢幕快照 2026-02-12 15-14-10

  1. Fix IndexError: list index out of range in write.py
    In write.py, the group_by_font function fails when it encounters characters that cannot be mapped to any predefined fonts (e.g., specific symbols or unidentifiable whitespace), resulting in an empty groups list. Attempting to access groups[0] without verification causes a crash.
螢幕快照 2026-02-12 15-15-04

Changes:

  • Added a safety check to ensure groups is not empty before accessing its elements.

After Fix:
螢幕快照 2026-02-12 15-16-51
sugar_by_maroon_5_6a2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant