statify icon indicating copy to clipboard operation
statify copied to clipboard

null track cause boom boom

Open jclerc opened this issue 4 years ago • 0 comments

hi @foobuzz i've a new error for you

Traceback (most recent call last):
  File "/home/pi/.local/bin/statify", line 10, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 36, in
    code = _main(args)
  File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 100, in
    pull_playlists(spotify, database)
  File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 171, in
    spotify_tracks = list(spotify.playlist_tracks(playlist_obj.spotify_id))
  File "/home/pi/.local/lib/python3.7/site-packages/statify/spotify_client.py", line
    p_track['track'] = self.track_transformer(p_track['track'])
  File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 145, in
    if resource['id'] is None and resource['is_local']:
TypeError: 'NoneType' object is not subscriptable

i added a print somewhere and after dumping a lot of stuff, it happened:

{'added_at': '2021-05-06T22:15:57Z', 'added_by': {'external_urls': {'spotify': 'https://open.spotify.com/user/'}, 'href': 'https://api.spotify.com/v1/users/', 'id': '', 'type': 'user', 'uri': 'spotify:user:'}, 'is_local': False, 'primary_color': None, 'track': None, 'video_thumbnail': {'url': None}}

so after a huge amount of reverse engineering and using the web ui of github i'll make a pr in the next few minutes, stay tuned

jclerc avatar May 11 '21 19:05 jclerc