From 8fabb0de86a0f2b103452ddc61b5ef7fd8adb871 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sun, 5 Apr 2026 19:43:01 +0200 Subject: [PATCH] fix: handle inconsistent response format of mxm --- lrx_cli/fetchers/musixmatch.py | 4 ++++ pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lrx_cli/fetchers/musixmatch.py b/lrx_cli/fetchers/musixmatch.py index 627b7c9..f30b78e 100644 --- a/lrx_cli/fetchers/musixmatch.py +++ b/lrx_cli/fetchers/musixmatch.py @@ -170,6 +170,8 @@ class MusixmatchSpotifyFetcher(BaseFetcher): self.auth, {"track_spotify_id": track.trackid}, # type: ignore[dict-item] ) + except AttributeError: + return LyricResult(status=CacheStatus.NOT_FOUND, ttl=TTL_NOT_FOUND) except Exception as e: logger.error(f"Musixmatch-Spotify: fetch failed: {e}") return LyricResult(status=CacheStatus.NETWORK_ERROR, ttl=TTL_NETWORK_ERROR) @@ -275,6 +277,8 @@ class MusixmatchFetcher(BaseFetcher): self.auth, {"commontrack_id": str(commontrack_id)}, ) + except AttributeError: + return LyricResult(status=CacheStatus.NOT_FOUND, ttl=TTL_NOT_FOUND) except Exception as e: logger.error(f"Musixmatch: fetch failed: {e}") return LyricResult(status=CacheStatus.NETWORK_ERROR, ttl=TTL_NETWORK_ERROR) diff --git a/pyproject.toml b/pyproject.toml index 0e284aa..266b774 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "lrx-cli" -version = "0.5.3" +version = "0.5.4" description = "Fetch line-synced lyrics for your music player." readme = "README.md" requires-python = ">=3.13" diff --git a/uv.lock b/uv.lock index d6487e7..46bd90d 100644 --- a/uv.lock +++ b/uv.lock @@ -153,7 +153,7 @@ wheels = [ [[package]] name = "lrx-cli" -version = "0.5.3" +version = "0.5.4" source = { editable = "." } dependencies = [ { name = "cyclopts" },