Skip to content

fix: Shuffle play videos#345

Merged
PartyDonut merged 2 commits into
developfrom
bugfix/shuffle-videos
May 17, 2025
Merged

fix: Shuffle play videos#345
PartyDonut merged 2 commits into
developfrom
bugfix/shuffle-videos

Conversation

@PartyDonut

Copy link
Copy Markdown
Collaborator

Pull Request Description

Apply shuffle to photo/video libraries
Fix non-video files being added to playback list when playing videos

Issue Being Fixed

Resolves #322

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @PartyDonut - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

PageTransition(
child: PhotoViewerScreen(
items: allItems,
items: shuffle ? allItems.shuffled() : allItems,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): indexOfSelected not recalculated for shuffled items

Compute indexOfSelected on shuffled items when shuffle is true to avoid opening the wrong photo.

@sourcery-ai

sourcery-ai Bot commented May 17, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR enhances the library playback flow by restricting to playable video items, propagating the shuffle flag to playback APIs, and applying shuffle to the photo viewer list when shuffle mode is enabled.

File-Level Changes

Change Details Files
Filter out non-playable media items before initiating video playback
  • Inserted a filter to only include types recognised as playable
  • Ensured itemsToPlay list excludes non-video files
lib/providers/library_search_provider.dart
Propagate shuffle option to the video playback routine
  • Added shuffle parameter to playLibraryItems invocation
  • Removed hardcoded playback order in favor of shuffle-aware logic
lib/providers/library_search_provider.dart
Apply shuffle to the photo viewer’s item list when requested
  • Wrap allItems with .shuffled() if shuffle flag is true
  • Maintain original order when shuffle is disabled
lib/providers/library_search_provider.dart

Assessment against linked issues

Issue Objective Addressed Explanation
#322 The shuffle button should shuffle the selected items.
#322 The shuffle button should play the shuffled items.
#322 When playing videos, only video files should be added to the playback list.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@PartyDonut PartyDonut added the bug Something isn't working label May 17, 2025
@PartyDonut PartyDonut merged commit 1a8765f into develop May 17, 2025
1 check passed
@PartyDonut PartyDonut deleted the bugfix/shuffle-videos branch May 17, 2025 14:35
@github-project-automation github-project-automation Bot moved this to Done in Fladder May 17, 2025
Julien9969 pushed a commit to Julien9969/Fladder that referenced this pull request May 20, 2025
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
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 is broken

1 participant