* fix(tidal): auth refresh time diff
Auth expiration check was using only 60 seconds rather than the intended
60 minutes. Using timedelta to show full intention
Closes #4425
* fix(tidal): invert current logic, and use constant for buffer
AUTH_URL = "https://auth.tidal.com/v1/oauth2"
REDIRECT_URI = "https://tidal.com/android/login/auth"
+TOKEN_REFRESH_BUFFER = 60 * 7 # 7 minutes
+
@dataclass
class TidalUser:
# Check if token is expired
expires_at = self._auth_info.get("expires_at", 0) # type: ignore[unreachable]
- if expires_at > time.time() - 60:
+ if expires_at > time.time() + TOKEN_REFRESH_BUFFER:
return True
# Need to refresh token