Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.3.5 problem with Get Tracks #11

Open
Barry4679 opened this issue Apr 15, 2020 · 2 comments
Open

0.3.5 problem with Get Tracks #11

Barry4679 opened this issue Apr 15, 2020 · 2 comments

Comments

@Barry4679
Copy link

I installed your app on Windows. It runs well. ... Thanks.
All good except this issue.

my command was sonos get tracks -p 4
where the 4 was the id of one of the playlists that I retrieved via sonos get playlists

The error is:

D:\My Documents\Python\sonos-cli-master\sonos>sonos get tracks -p 4
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\sonos.exe_main
.py", line 7, in
File "c:\program files\python38\lib\site-packages\click\core.py", line 829, in call
return self.main(*args, **kwargs)
File "c:\program files\python38\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "c:\program files\python38\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files\python38\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files\python38\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files\python38\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Users\xxxxx\AppData\Roaming\Python\Python38\site-packages\sonos_cli-0.3.5-py3.8.egg\sonos\decorators.py", line 58, in wrapper_login_required
return func(*args, **kwargs)
File "C:\Users\xxxxx\AppData\Roaming\Python\Python38\site-packages\sonos_cli-0.3.5-py3.8.egg\sonos\decorators.py", line 37, in wrapper_format_result
print_table()
File "C:\Users\xxxxx\AppData\Roaming\Python\Python38\site-packages\sonos_cli-0.3.5-py3.8.egg\sonos\decorators.py", line 24, in print_table
rows = [[row[header] for header in headers] for row in table_data]
File "C:\Users\xxxxx\AppData\Roaming\Python\Python38\site-packages\sonos_cli-0.3.5-py3.8.egg\sonos\decorators.py", line 24, in
rows = [[row[header] for header in headers] for row in table_data]
File "C:\Users\xxxxx\AppData\Roaming\Python\Python38\site-packages\sonos_cli-0.3.5-py3.8.egg\sonos\decorators.py", line 24, in
rows = [[row[header] for header in headers] for row in table_data]
KeyError: 'name'

Debug in Get.py, in statement 49 in the Tracks function, shows

result
{'id': '4', 'name': 'Anne 1', 'type': 'playlistSummary', 'tracks': [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]}
len(result['tracks'])
100

It seems to be trying to download something ... is strange that the dict at result['tracks'] has 100 entries, because the playlist has 104 tracks.

@bwilczynski
Copy link
Owner

Hmm... is it only for this particular playlist? Or you're getting it for the others as well?

@Barry4679
Copy link
Author

It happens with every playlist that I have tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants