fix: handle inconsistent response format of mxm
This commit is contained in:
@@ -170,6 +170,8 @@ class MusixmatchSpotifyFetcher(BaseFetcher):
|
|||||||
self.auth,
|
self.auth,
|
||||||
{"track_spotify_id": track.trackid}, # type: ignore[dict-item]
|
{"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:
|
except Exception as e:
|
||||||
logger.error(f"Musixmatch-Spotify: fetch failed: {e}")
|
logger.error(f"Musixmatch-Spotify: fetch failed: {e}")
|
||||||
return LyricResult(status=CacheStatus.NETWORK_ERROR, ttl=TTL_NETWORK_ERROR)
|
return LyricResult(status=CacheStatus.NETWORK_ERROR, ttl=TTL_NETWORK_ERROR)
|
||||||
@@ -275,6 +277,8 @@ class MusixmatchFetcher(BaseFetcher):
|
|||||||
self.auth,
|
self.auth,
|
||||||
{"commontrack_id": str(commontrack_id)},
|
{"commontrack_id": str(commontrack_id)},
|
||||||
)
|
)
|
||||||
|
except AttributeError:
|
||||||
|
return LyricResult(status=CacheStatus.NOT_FOUND, ttl=TTL_NOT_FOUND)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Musixmatch: fetch failed: {e}")
|
logger.error(f"Musixmatch: fetch failed: {e}")
|
||||||
return LyricResult(status=CacheStatus.NETWORK_ERROR, ttl=TTL_NETWORK_ERROR)
|
return LyricResult(status=CacheStatus.NETWORK_ERROR, ttl=TTL_NETWORK_ERROR)
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "lrx-cli"
|
name = "lrx-cli"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
description = "Fetch line-synced lyrics for your music player."
|
description = "Fetch line-synced lyrics for your music player."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
|
|||||||
Reference in New Issue
Block a user