Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make movie's shuffle button use the current filters #6111

Merged
merged 4 commits into from
Sep 27, 2024

Conversation

davidmurdoch
Copy link
Contributor

@davidmurdoch davidmurdoch commented Sep 24, 2024

Changes

Updates the random movies button so it chooses a random movie from the filtered list, instead of choosing a random movie from all movies.

Note: I do think this was the original intent of the movie's Shuffle button, as the button is removed from the UI when the applied filters return 0 movies.

Issues
Fixes #3732

@davidmurdoch davidmurdoch requested a review from a team as a code owner September 24, 2024 16:45
@dmitrylyzo
Copy link
Contributor

Could you also rebase your branch onto recent master and force-push?

@davidmurdoch
Copy link
Contributor Author

Could you also rebase your branch onto recent master and force-push?

Done. Let me know if you need the loading.hide() added in the finally block, too (or feel free to commit and merge to this branch yourself!)

Copy link
Contributor

@dmitrylyzo dmitrylyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it a bit more.
Previously, it randomly played the entire Movie library (not just one random movie).
Shuffle button on the list page seems to be implemented this way:

function shuffle() {
const currentItem = self.currentItem;
if (currentItem && !self.hasFilters) {
playbackManager.shuffle(currentItem);
} else {
getItems(self, self.params, currentItem, 'Random', 0, 300).then(function (result) {
playbackManager.play({
items: result.Items,
autoplay: true
});
});
}
}

src/controllers/movies/movies.js Outdated Show resolved Hide resolved
@dmitrylyzo dmitrylyzo added the bug Something isn't working label Sep 26, 2024
@dmitrylyzo dmitrylyzo added this to the v10.10.0 milestone Sep 26, 2024
Copy link

sonarcloud bot commented Sep 26, 2024

@davidmurdoch
Copy link
Contributor Author

@dmitrylyzo I merged your latest suggested changes. Do we still need the finally block added in a previous commit?

@jellyfin-bot
Copy link
Collaborator

Cloudflare Pages deployment

Latest commit ce4aded6545752fb2a34b7cef23b4f62cfb533d8
Status ✅ Deployed!
Preview URL https://bab52c59.jellyfin-web.pages.dev
Type 🔀 Preview

@dmitrylyzo
Copy link
Contributor

Do we still need the finally block added in a previous commit?

Yes, because isLoading = true is still there and we need to reset it.

@thornbill thornbill merged commit c5bebf7 into jellyfin:master Sep 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Shuffle button functionality currently shuffles the whole collection/library, ignoring filters
4 participants