Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

Weighted Shuffle Implementation Plan

  • Create ShuffleMode enum (Random, Weighted/Smart)
  • Add ShuffleMode property to AppStateModel and settings service
  • Create IWeightedShuffleService interface
  • Implement WeightedShuffleService with weight calculation algorithm
    • Calculate weights based on Rating, IsFavorite, PlayCompletedCount, SkipCount, LastPlayed
    • Handle hidden songs (weight = 0)
    • Implement weighted random selection algorithm
  • Update EnumerableExtensions with WeightedShuffleInPlace method
  • Update QueueManager to support weighted shuffle
  • Update BaseViewModel ToggleShuffle to use weighted shuffle when enabled
  • Add UI toggle for shuffle mode (Random vs Smart)
  • Add comprehensive unit tests for weighted shuffle logic
  • Manual testing and verification
  • Security and code review
Original prompt

This section details on the original issue you should resolve

<issue_title>Weighted / Probability-Based Shuffle (per track, rating & behavior driven)</issue_title>
<issue_description>Context
I came across a Reddit discussion where a user was looking for a music player that allows setting a probability for each track when using shuffle. Historically, this existed in Windows Media Player via ratings → probability, but modern players no longer support it well.
This aligns strongly with how Dimmer already models song behavior and intent.

Problem
Current shuffle modes are purely random and ignore:
user ratings
favorites
skip behavior
listening history
This makes “random” feel repetitive or disconnected from user taste.
Proposed Solution
Introduce a Weighted Shuffle (Smart Shuffle) mode where each song has a calculated weight instead of equal probability.
Selection is still random, but biased by user behavior.
Weight inputs (already available in Dimmer):
Rating
ManualFavoriteCount / IsFavorite
PlayCompletedCount
SkipCount
LastPlayed (recency)
Hidden songs → weight 0

Example behavior
Favorite + highly rated songs appear more often
Frequently skipped songs fade out naturally
Songs not played in a long time slowly regain weight
Hidden songs are never picked

Algorithm (high-level)
Compute a weight per song (integer ≥ 0)
Sum all weights
Pick a random number in [0..totalWeight)
Return the song whose cumulative weight contains that number

  • Optional Enhancements to add too!

Cooldown window to avoid repeats
Playlist-scoped weighting
Toggle between:
Pure Random
Smart (Weighted)
Debug view: “Why this song was picked”

  • Why this matters
    Preserves randomness while respecting taste
    No micromanagement required
    Differentiates Dimmer from most players
    Cross-platform friendly, no platform APIs needed

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: YBTopaz8 <41630728+YBTopaz8@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weighted / Probability-Based Shuffle (per track, rating & behavior driven)

2 participants