refactor: add is_available method to fetchers

This commit is contained in:
2026-03-31 16:56:49 +02:00
parent 8e0f3c7af5
commit e8d9299939
9 changed files with 29 additions and 12 deletions
+3
View File
@@ -32,6 +32,9 @@ class QQMusicFetcher(BaseFetcher):
def source_name(self) -> str:
return "qqmusic"
def is_available(self, track: TrackMeta) -> bool:
return bool(track.title) and bool(QQ_MUSIC_API_URL)
def _search(self, track: TrackMeta, limit: int = 10) -> Optional[str]:
"""Search QQ Music and return the best-matching song MID."""
query = f"{track.artist or ''} {track.title or ''}".strip()