Play first podcast episode in table #4035
Merged
+14
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brief summary
This PR changes the "Play" button on the podcast page to play the first incomplete episode in the table instead of the "newest published". The "first episode" is the top row, and is dependent on the sorting and filtering options.
Which issue is fixed?
Related to #1321.
In-depth Description
This PR adds a new field to the Vuex store to track the podcast episode IDs in the
LazyEpisodesTable
. This takes the current sorting and filtering of the table into account. Then, when pressing the "Play" button, the uppermost incomplete episode is played instead of the most recently released incomplete episode.This does not fully fix the issue as mentioned in #1321 (comment) because the sorting is applied to all podcasts instead of being remembered individually. No changes should need to be made for this logic once the sort order is podcast specific.
Commit overview:
sortedEpisodeIds
to the store, which stores the episode IDs of the sorted and filtered table.Additional question Should this just play the very first episode instead of the first incomplete episode? The filter defaults to "incomplete", so if a user has changed to show all episodes, I think it should play whatever is in the first row, regardless of the completion status.
How have you tested this?
Added several podcasts (some serial and some episodic). Changed sort and filter options, navigating between podcasts to ensure that the state was being updated correctly and the first incomplete episode was correctly played.
Screenshots
To illustrate what is happening, the episode in the red box is the episode which will be played when pressing the "Play" button above the description.