Taiko2k / Tauon

The music player of today! :city_sunrise:
https://tauonmusicbox.rocks
GNU General Public License v3.0
1.64k stars 64 forks source link

Tauon crashes when importing Spotify playlists if the user has playlist folders. #1125

Open RileyInkTheCat opened 2 months ago

RileyInkTheCat commented 2 months ago

System: Flatpak Tauon in ArchLinux

Issue: When trying to import Spotify playlists via this button:

image

Tauon will completely crash and blurp out the following error in a terminal At first I tried to reinstall Tauon, and then after investigating the error message I had a feeling it could be to do with a playlist name or something of the sort. (In Spotify) Started by all playlists outside of folders and then deleting the folders, this time Tauon works as intended, allowing me to import playlists without crashing.

Traceback (most recent call last):
  File "/app/bin/tauon.py", line 352, in <module>
    from t_modules import t_main
  File "/app/bin/t_modules/t_main.py", line 47427, in <module>
    instance.render()
  File "/app/bin/t_modules/t_main.py", line 14320, in render
    self.subs[self.sub_active][w].func()
  File "/app/bin/t_modules/t_main.py", line 23447, in spot_import_playlist_menu
    playlists = spot_ctl.get_playlist_list()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bin/t_modules/t_spot.py", line 311, in get_playlist_list
    results = self.spotify.playlists(self.spotify.current_user().id)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/tekore/_sender/client.py", line 79, in wrapper
    return post_func(request, response, *params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/tekore/_client/decor/__init__.py", line 20, in parse_response
    return post_func(response.content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/tekore/_client/process.py", line 25, in post_func
    return type_.from_kwargs(json) if json is not None else None
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/tekore/_model/serialise.py", line 206, in from_kwargs
    model = cls(**known_kwargs)
            ^^^^^^^^^^^^^^^^^^^
  File "<string>", line 10, in __init__
  File "/app/lib/python3.11/site-packages/tekore/_model/playlist.py", line 149, in __post_init__
    self.items = ModelList(SimplePlaylist(**p) for p in self.items)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/tekore/_model/playlist.py", line 149, in <genexpr>
    self.items = ModelList(SimplePlaylist(**p) for p in self.items)
                           ^^^^^^^^^^^^^^^^^^^
  File "<string>", line 17, in __init__
  File "/app/lib/python3.11/site-packages/tekore/_model/playlist.py", line 125, in __post_init__
    super().__post_init__()
  File "/app/lib/python3.11/site-packages/tekore/_model/playlist.py", line 113, in __post_init__
    self.images = ModelList(Image(**i) for i in self.images)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable