diff --git a/pomice/objects.py b/pomice/objects.py index a5ece2c..e7a3cf9 100644 --- a/pomice/objects.py +++ b/pomice/objects.py @@ -74,7 +74,6 @@ class Playlist: self.spotify = spotify self.name = playlist_info.get("name") - self.selected_track = playlist_info.get("selectedTrack") self._thumbnail = thumbnail self._uri = uri @@ -87,6 +86,11 @@ class Playlist: for track in self.tracks_raw ] + if (index := playlist_info.get("selectedTrack")) == -1: + self.selected_track = None + else: + self.selected_track = self.tracks[index] + self.track_count = len(self.tracks) def __str__(self): diff --git a/pomice/pool.py b/pomice/pool.py index da7cd19..9a15048 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -307,7 +307,7 @@ class Node: "identifier": spotify_results.id, "uri": spotify_results.uri, "isStream": False, - "isSeekable": False, + "isSeekable": True, "position": 0, "thumbnail": spotify_results.image } @@ -327,7 +327,7 @@ class Node: "identifier": track.id, "uri": track.uri, "isStream": False, - "isSeekable": False, + "isSeekable": True, "position": 0, "thumbnail": track.image } @@ -335,7 +335,7 @@ class Node: ] return Playlist( - playlist_info={"name": spotify_results.name, "selectedTrack": tracks[0]}, + playlist_info={"name": spotify_results.name, "selectedTrack": 0}, tracks=tracks, ctx=ctx, spotify=True,