added catch for no network username
This commit is contained in:
parent
25e6998a79
commit
f868d1425a
@ -27,7 +27,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
logger.addHandler(stream_handler)
|
logger.addHandler(stream_handler)
|
||||||
|
|
||||||
try:
|
# try:
|
||||||
|
|
||||||
network = Network(NetworkUser(os.environ['SPOTCLIENT'],
|
network = Network(NetworkUser(os.environ['SPOTCLIENT'],
|
||||||
os.environ['SPOTSECRET'],
|
os.environ['SPOTSECRET'],
|
||||||
@ -50,5 +50,5 @@ if __name__ == '__main__':
|
|||||||
for play in playlists:
|
for play in playlists:
|
||||||
csvwrite.export_playlist(play, totalpath)
|
csvwrite.export_playlist(play, totalpath)
|
||||||
|
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
logger.exception(f'exception occured')
|
# logger.exception(f'exception occured')
|
||||||
|
@ -284,7 +284,10 @@ class Network:
|
|||||||
|
|
||||||
playlists = self.get_playlists()
|
playlists = self.get_playlists()
|
||||||
|
|
||||||
if playlists:
|
if self.user.username is None:
|
||||||
|
self.user.refresh_info()
|
||||||
|
|
||||||
|
if playlists is not None:
|
||||||
return list(filter(lambda x: x.owner.username == self.user.username, playlists))
|
return list(filter(lambda x: x.owner.username == self.user.username, playlists))
|
||||||
else:
|
else:
|
||||||
logger.error('no playlists returned to filter')
|
logger.error('no playlists returned to filter')
|
||||||
|
Loading…
Reference in New Issue
Block a user