Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tehkillerbee committed Feb 7, 2024
1 parent 225263a commit 58f7b9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tidalapi/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,11 @@ def parse(self, json_obj: JsonObj) -> "Stream":
self.album_peak_amplitude = json_obj["albumPeakAmplitude"]
self.track_replay_gain = json_obj["trackReplayGain"]
self.track_peak_amplitude = json_obj["trackPeakAmplitude"]
if not (self.audio_quality == Quality.low_96k.value or self.audio_quality == Quality.low_320k.value or self.audio_quality == Quality.hi_res.value):
if not (
self.audio_quality == Quality.low_96k.value
or self.audio_quality == Quality.low_320k.value
or self.audio_quality == Quality.hi_res.value
):
# Bit depth, Sample rate not available for low quality modes. Assuming 16bit/44100Hz
self.bit_depth = json_obj["bitDepth"]
self.sample_rate = json_obj["sampleRate"]
Expand Down
8 changes: 6 additions & 2 deletions tidalapi/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,12 @@ def token_refresh(self, refresh_token: str) -> bool:
params = {
"grant_type": "refresh_token",
"refresh_token": refresh_token,
"client_id": self.config.client_id_pkce if self.is_pkce else self.config.client_id,
"client_secret": self.config.client_secret_pkce if self.is_pkce else self.config.client_secret,
"client_id": self.config.client_id_pkce
if self.is_pkce
else self.config.client_id,
"client_secret": self.config.client_secret_pkce
if self.is_pkce
else self.config.client_secret,
}

request = self.request_session.post(url, params)
Expand Down

0 comments on commit 58f7b9a

Please sign in to comment.