Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

empty playlists result in 'TypeError: list indices must be integers, not str' #26

@ArthurMoore85

Description

@ArthurMoore85

If a user has no playlists, the app will crash with the error
TypeError: list indices must be integers, not str

This can be avoided by changing the line
playlists = list_playlists(api,playlist_ids)
with an if loop:

if len(playlist_ids) > 0:
            playlists = list_playlists(api,playlist_ids)
        else:
            playlists = [{'subtreeline': 0, 'name': 'pid', 'subtree': 0}]

This results however in the error:

s = (str(song['track']) if 'track' in song else 'x') + '. ' + song['name']
KeyError: 'name'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions