Skip to content

Commit 67fa0c1

Browse files
authored
Merge pull request #181 from tehkillerbee/180-fix-python-tidal-v080-support
Fix login_oauth_simple args. Formatting
2 parents cfb6cf0 + c25ccb9 commit 67fa0c1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

mopidy_tidal/backend.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from mopidy import backend
1010
from pykka import ThreadingActor
11-
from tidalapi import Config, Quality, Session
11+
from tidalapi import Config, Session
1212
from tidalapi import __version__ as tidalapi_ver
1313

1414
from mopidy_tidal import Extension
@@ -132,7 +132,7 @@ def _login(self):
132132
if not self.login_server_port:
133133
# A. Default login, user must find login URL in Mopidy log
134134
logger.info("Creating new session (OAuth)...")
135-
self._active_session.login_oauth_simple(function=logger.info)
135+
self._active_session.login_oauth_simple(fn_print=logger.info)
136136
else:
137137
# B. Interactive login, user must perform login using web auth
138138
logger.info(
@@ -186,9 +186,9 @@ def _web_auth_callback(self, url_redirect: str):
186186
if self.pkce_enabled:
187187
try:
188188
# Query for auth tokens
189-
json: dict[
190-
str, Union[str, int]
191-
] = self._active_session.pkce_get_auth_token(url_redirect)
189+
json: dict[str, Union[str, int]] = (
190+
self._active_session.pkce_get_auth_token(url_redirect)
191+
)
192192
# Parse and set tokens.
193193
self._active_session.process_auth_token(json, is_pkce_token=True)
194194
self._logged_in = True

mopidy_tidal/playlists.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ def _calculate_added_and_removed_playlist_ids(
7777
2, thread_name_prefix="mopidy-tidal-playlists-refresh-"
7878
) as pool:
7979
pool_res = pool.map(
80-
lambda func: get_items(func)
81-
if func == session.user.favorites.playlists
82-
else func(),
80+
lambda func: (
81+
get_items(func)
82+
if func == session.user.favorites.playlists
83+
else func()
84+
),
8385
[
8486
session.user.favorites.playlists,
8587
session.user.playlists,

tests/test_context.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test context, which is used to manage config."""
2+
23
import pytest
34

45
from mopidy_tidal import context

0 commit comments

Comments
 (0)