Skip to content

Commit b422c15

Browse files
committed
unset active session from lib on failure
1 parent 0d4d0a2 commit b422c15

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/ampache.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ def handshake(self, ampache_url: str, ampache_api: str, ampache_user: str = Fals
526526
self.AMPACHE_SESSION = json_data['auth']
527527
return json_data['auth']
528528
else:
529+
self.AMPACHE_SESSION = False
529530
return False
530531
# xml format
531532
else:
@@ -565,6 +566,7 @@ def ping(self, ampache_url: str, ampache_api: str = False, version: str = '6.6.0
565566
full_url = ampache_url + '?' + data
566567
ampache_response = self.fetch_url(full_url, self.AMPACHE_API, 'ping')
567568
if not ampache_response:
569+
self.AMPACHE_SESSION = False
568570
return False
569571
# json format
570572
if self.AMPACHE_API == 'json':
@@ -577,6 +579,7 @@ def ping(self, ampache_url: str, ampache_api: str = False, version: str = '6.6.0
577579
self.AMPACHE_SESSION = ampache_api
578580
return ampache_api
579581
else:
582+
self.AMPACHE_SESSION = False
580583
return False
581584
# xml format
582585
else:

0 commit comments

Comments
 (0)