Skip to content

Commit

Permalink
Fixed bug where non-playlist songs were not read correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Oceanity committed Jun 8, 2024
1 parent 84625a5 commit ee7f83e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utils/spotify/player/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,11 @@ export default class SpotifyPlayerService {
this._isPlaying = state.is_playing;
}

if (state.context && this.playlist.id !== state.context.uri) {
if (
state.context &&
state.context.type === "playlist" &&
this.playlist.id !== state.context.uri
) {
await this.playlist.updateCurrentPlaylistAsync(state.context.uri);
}

Expand Down Expand Up @@ -409,9 +413,6 @@ export default class SpotifyPlayerService {
//#endregion

//#region Helper Methods
private readonly getBiggestImage = (images: SpotifyImage[]) =>
images.reduce((a, b) => (a.width > b.width ? a : b));

private useCachedDeviceId = () =>
this.activeDeviceId != null &&
this.lastDevicePollTime != null &&
Expand Down

0 comments on commit ee7f83e

Please sign in to comment.