feat(downloads): random episode selection + Custom Amount (Any)#1199
Open
Darkmadda wants to merge 6 commits into
Open
feat(downloads): random episode selection + Custom Amount (Any)#1199Darkmadda wants to merge 6 commits into
Darkmadda wants to merge 6 commits into
Conversation
Add a "Random episodes" toggle to the show/season download-options dialog. When enabled, the count-limited options (Next 5, Next 10, Custom Amount) fill their quota with randomly chosen episodes instead of release order. The toggle is a sticky switch pinned atop the dialog (it does not dismiss on flip). Split "Custom amount" into Custom Amount (Unwatched) and a new Custom Amount (Any). The (Any) variant uses the same count dialog but includes watched episodes too. Both Custom variants, and random, persist into keep-synced rules: show/season sync rules now honor downloadFilter (previously hardcoded unwatched) and a new randomEpisodes flag. Random fills only the deficit and never re-randomizes existing downloads, so reconciles do not thrash. "Any" rules (downloadFilter=all) are exempted from the watched-auto-delete cleanup so their watched episodes are retained instead of deleted-and-redownloaded. Schema v16 adds SyncRules.randomEpisodes (default false); existing rules keep in-order, unwatched behavior. New i18n strings added to the base locale (others fall back). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ownload_random_episodes # Conflicts: # lib/utils/download_utils.dart
…nload_random_episodes # Conflicts: # lib/i18n/strings.g.dart # lib/services/sync_rule_executor.dart # lib/utils/download_utils.dart
…nload_random_episodes # Conflicts: # lib/i18n/strings.g.dart # lib/i18n/strings_en.g.dart
# Conflicts: # lib/i18n/strings.g.dart # lib/i18n/strings_en.g.dart
…ownload_random_episodes # Conflicts: # lib/i18n/strings.g.dart # lib/i18n/strings_en.g.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds the ability to download/sync random episodes of TV shows, and splits "Custom amount" into (Unwatched) and (Any) variants.
Changes
Random episodes toggle
showOptionPickerDialoggained an optional toggle header). Flipping it doesn't dismiss the dialog.Custom Amount split
filter = all).Sync persistence
downloadFilter(previously hardcoded to unwatched) and a newrandomEpisodesflag.Correctness / no churn
downloadFilter == 'all') are exempted from the watched-auto-delete cleanup — their watched episodes are retained rather than deleted and re-downloaded.Database
SyncRules.randomEpisodes(bool, defaultfalse) via the standard additive migration. Existing rules keep their current in-order, unwatched behavior.downloadFilteralready existed (default'unwatched'), so honoring it for show/season rules is backward-compatible.i18n
downloads.randomEpisodes,downloads.customAmountUnwatched,downloads.customAmountAny(replacing the now-unusedcustomAmount). Other locales fall back to base.Testing
Sync-rule executor test suite passes; analyzer clean. Verified manually: random Next-N queues a random unwatched subset; Custom Amount (Any) grabs N random episodes incl. watched; a synced random-unwatched rule refills with new random episodes after watching; a synced (Any) rule's watched episodes survive the cleanup; non-random and existing rules are unchanged after migration.
🤖 Generated with Claude Code