feat: add Soulseek to the config-aware registry
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
from lyra_worker.adapters._slskd import SlskdClient
|
||||
from lyra_worker.adapters._streamrip import StreamripClient
|
||||
from lyra_worker.adapters._ytdlp import YtDlpClient
|
||||
from lyra_worker.adapters.base import SourceAdapter
|
||||
from lyra_worker.adapters.qobuz import QobuzAdapter
|
||||
from lyra_worker.adapters.soulseek import SoulseekAdapter
|
||||
from lyra_worker.adapters.youtube import YouTubeAdapter
|
||||
|
||||
|
||||
def build_adapters(config: dict) -> list[SourceAdapter]:
|
||||
"""Real source adapters, best-tier first, filtered to those that are configured.
|
||||
|
||||
An adapter is included only if its health() is true (e.g. Qobuz requires
|
||||
credentials in config). Plan 3d adds Soulseek (slskd) the same way.
|
||||
An adapter is included only if its health() is true (Qobuz needs credentials,
|
||||
Soulseek needs an slskd URL + API key). YouTube needs no config.
|
||||
"""
|
||||
candidates: list[SourceAdapter] = [
|
||||
QobuzAdapter(StreamripClient(config)),
|
||||
SoulseekAdapter(SlskdClient(config)),
|
||||
YouTubeAdapter(YtDlpClient()),
|
||||
]
|
||||
return [a for a in candidates if a.health()]
|
||||
|
||||
Reference in New Issue
Block a user