and3rson / clay

Awesome standalone command line player for Google Play Music.
GNU General Public License v3.0
157 stars 11 forks source link

Library fails to load when uploaded songs are present #1

Closed nahun closed 6 years ago

nahun commented 6 years ago

After entering my credentials I get the following exceptions. I'm using an App password to login since I have 2FA setup, not sure if that matters.

I installed with pip and then tried the manual method as well with virtualenv and got the same error.

Traceback (most recent call last):
  File "./clay/gp.py", line 40, in process
    result = func(*args, **kwargs)
  File "./clay/gp.py", line 65, in wrapper
    return func(*args, **kwargs)
  File "./clay/gp.py", line 496, in get_all_user_playlist_contents
    self.get_all_tracks()
  File "./clay/gp.py", line 65, in wrapper
    return func(*args, **kwargs)
  File "./clay/gp.py", line 476, in get_all_tracks
    self.cached_tracks = Track.from_data(data, Track.SOURCE_LIBRARY, True)
  File "./clay/gp.py", line 127, in from_data
    return [cls.from_data(one, source) for one in data]
  File "./clay/gp.py", line 127, in <listcomp>
    return [cls.from_data(one, source) for one in data]
  File "./clay/gp.py", line 160, in from_data
    store_id=data['storeId'],
KeyError: 'storeId'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "./clay/gp.py", line 42, in process
    callback(None, error, **extra)
  File "./clay/pages/myplaylists.py", line 89, in on_get_playlists
    for playlist in playlists:
TypeError: 'NoneType' object is not iterable

I honestly didn't do much troubleshooting, sorry. But the project looks pretty cool,

and3rson commented 6 years ago

Thanks for the report! I'll take a look at in around an hour.

and3rson commented 6 years ago

@nahun Do you have any uploaded songs in your library?

Also, can you please pull fresh code from master and post a new error here? The data that causes an error will help me in debugging.

and3rson commented 6 years ago

I've just fixed a typo, you can try now. Thanks!

DelusionalLogic commented 6 years ago

I'm having the same issue. I can't quite post the traceback, since it appear impossible to copy from the client, and it swallows my error. I might suggest making a flag to allow error logging to a file.

Anyhow, it seems to stumble on uploaded songs, even in master. Here's a screenshot:

image

To me it seems acceptable to just not show the store_id if it's not present.

and3rson commented 6 years ago

@DelusionalLogic Thanks for reporting! I've pushed a temporary workaround to skip such tracks so that you can use app while I'm still fixing it. Can you try it again?

DelusionalLogic commented 6 years ago

The fix seems to work for now 👍 🎉

and3rson commented 6 years ago

Thanks for confirmation!