move _jwt_is_expired to utils

This commit is contained in:
Michaël De Boey
2025-03-16 23:40:50 +01:00
parent 98a68be9b8
commit 1b1117a9c5
12 changed files with 32 additions and 22 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ from ..utils import (
determine_ext,
int_or_none,
join_nonempty,
jwt_is_expired,
parse_duration,
parse_iso8601,
try_get,
@@ -351,7 +352,7 @@ mutation initPlaybackSession(
@property
def _api_headers(self):
if self._jwt_is_expired(self._access_token, 120):
if jwt_is_expired(self._access_token, 120):
self.write_debug('Access token has expired; re-logging in')
self._perform_login(*self._get_login_info())
return {'Authorization': f'Bearer {self._access_token}'}