fix: run Qobuz login inside try/finally and reuse a single streamrip config
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,8 +36,8 @@ class StreamripClient:
|
||||
from streamrip.client import QobuzClient
|
||||
|
||||
client = QobuzClient(self._make_config())
|
||||
await client.login()
|
||||
try:
|
||||
await client.login()
|
||||
pages = await client.search("album", query, limit=5)
|
||||
finally:
|
||||
await client.session.close()
|
||||
@@ -65,12 +65,13 @@ class StreamripClient:
|
||||
from streamrip.db import Database, Dummy
|
||||
from streamrip.media import PendingAlbum
|
||||
|
||||
client = QobuzClient(self._make_config(download_folder=dest))
|
||||
await client.login()
|
||||
cfg = self._make_config(download_folder=dest)
|
||||
client = QobuzClient(cfg)
|
||||
try:
|
||||
await client.login()
|
||||
on_progress(0.0)
|
||||
db = Database(downloads=Dummy(), failed=Dummy())
|
||||
pending = PendingAlbum(album_id, client, self._make_config(download_folder=dest), db)
|
||||
pending = PendingAlbum(album_id, client, cfg, db)
|
||||
album = await pending.resolve()
|
||||
if album is None:
|
||||
raise RuntimeError(f"could not resolve Qobuz album {album_id}")
|
||||
|
||||
Reference in New Issue
Block a user