Skip to content

Commit

Permalink
Merge pull request #181 from tehkillerbee/180-fix-python-tidal-v080-s…
Browse files Browse the repository at this point in the history
…upport

Fix login_oauth_simple args. Formatting
  • Loading branch information
tehkillerbee authored Oct 16, 2024
2 parents cfb6cf0 + c25ccb9 commit 67fa0c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions mopidy_tidal/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from mopidy import backend
from pykka import ThreadingActor
from tidalapi import Config, Quality, Session
from tidalapi import Config, Session
from tidalapi import __version__ as tidalapi_ver

from mopidy_tidal import Extension
Expand Down Expand Up @@ -132,7 +132,7 @@ def _login(self):
if not self.login_server_port:
# A. Default login, user must find login URL in Mopidy log
logger.info("Creating new session (OAuth)...")
self._active_session.login_oauth_simple(function=logger.info)
self._active_session.login_oauth_simple(fn_print=logger.info)
else:
# B. Interactive login, user must perform login using web auth
logger.info(
Expand Down Expand Up @@ -186,9 +186,9 @@ def _web_auth_callback(self, url_redirect: str):
if self.pkce_enabled:
try:
# Query for auth tokens
json: dict[
str, Union[str, int]
] = self._active_session.pkce_get_auth_token(url_redirect)
json: dict[str, Union[str, int]] = (
self._active_session.pkce_get_auth_token(url_redirect)
)
# Parse and set tokens.
self._active_session.process_auth_token(json, is_pkce_token=True)
self._logged_in = True
Expand Down
8 changes: 5 additions & 3 deletions mopidy_tidal/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ def _calculate_added_and_removed_playlist_ids(
2, thread_name_prefix="mopidy-tidal-playlists-refresh-"
) as pool:
pool_res = pool.map(
lambda func: get_items(func)
if func == session.user.favorites.playlists
else func(),
lambda func: (
get_items(func)
if func == session.user.favorites.playlists
else func()
),
[
session.user.favorites.playlists,
session.user.playlists,
Expand Down
1 change: 1 addition & 0 deletions tests/test_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test context, which is used to manage config."""

import pytest

from mopidy_tidal import context
Expand Down

0 comments on commit 67fa0c1

Please sign in to comment.