def playlists_and_tracks(spotify) -> dict:
    """Returns a dict including tracks like:
    {"Playlist_name": {
        "id": "playlist_id",
        "image_url": "the_url_to_the_icon_of_the_playlist"
        "tracks": [list of track IDs(first 100)]
    }
        }"""

    playlists_and_tracks = {}

    for item in spotify.current_user_playlists()["items"]:
        if item["owner"]["id"] == spotify.me()["id"]:
            playlists_and_tracks[item["name"]] = {
                "id": item["id"],
                "image_url": item["images"][0]["url"]
                if not item["images"] == []
                else "./assets/error.ico",
                "tracks": [
                    song["track"]["id"]
                    for song in spotify.playlist_tracks(item["id"])["items"]
                ],
            }

    return playlists_and_tracks