[PR #632] [MERGED] Fix use of incorrect playlist index when playing from an associated track table #940

Closed
opened 2026-02-28 14:53:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Rigellute/spotify-tui/pull/632
Author: @Utagai
Created: 10/23/2020
Status: Merged
Merged: 10/27/2020
Merged by: @Rigellute

Base: masterHead: incorrect-playlist-index


📝 Commits (1)

  • 9fac7b7 Fix use of incorrect playlist index when playing from an associated track table

📊 Changes

3 files changed (+6 additions, -4 deletions)

View changed files

📝 src/app.rs (+2 -0)
📝 src/handlers/playlist.rs (+1 -0)
📝 src/handlers/track_table.rs (+3 -4)

📄 Description

This closes #628.

We had a poor assumption here, that the selected playlist index was always guaranteed to be the playlist for which the loaded track table's context referred to. However, this is not always true. Take the following steps:

  1. Enter the playlists table.
  2. Active (press Enter) a playlist and subsequently load its track table.
  3. Leave the track table view and go back to the playlists table.
  4. Move the selection to another playlist, but do not activate (press Enter) it.
  5. Re-enter the track table, and try to play a song.

Step 5 will attempt to play a song on the selected playlist, which is the one you never activated, leading to an unexpected song being played back. Instead, we need a particular state for the activated playlist index, which this PR adds and uses instead. This avoids the problem described in the issue.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Rigellute/spotify-tui/pull/632 **Author:** [@Utagai](https://github.com/Utagai) **Created:** 10/23/2020 **Status:** ✅ Merged **Merged:** 10/27/2020 **Merged by:** [@Rigellute](https://github.com/Rigellute) **Base:** `master` ← **Head:** `incorrect-playlist-index` --- ### 📝 Commits (1) - [`9fac7b7`](https://github.com/Rigellute/spotify-tui/commit/9fac7b774d7a20b270385e229e34f11c13c5e3ff) Fix use of incorrect playlist index when playing from an associated track table ### 📊 Changes **3 files changed** (+6 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/app.rs` (+2 -0) 📝 `src/handlers/playlist.rs` (+1 -0) 📝 `src/handlers/track_table.rs` (+3 -4) </details> ### 📄 Description This closes #628. We had a poor assumption here, that the _selected_ playlist index was always guaranteed to be the playlist for which the loaded track table's context referred to. However, this is not always true. Take the following steps: 1. Enter the playlists table. 2. Active (press Enter) a playlist and subsequently load its track table. 3. Leave the track table view and go back to the playlists table. 4. Move the _selection_ to another playlist, but _do not activate (press Enter) it_. 5. Re-enter the track table, and try to play a song. Step 5 will attempt to play a song on the _selected_ playlist, which is the one you never activated, leading to an unexpected song being played back. Instead, we need a particular state for the _activated_ playlist index, which this PR adds and uses instead. This avoids the problem described in the issue. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 14:53:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#940
No description provided.