Repository navigation
Add manual watched and unwatched toggles for movies, episodes, series, and seasons - #39
Conversation
Store an explicit completion flag so a title can be marked watched even when catalogue metadata has no runtime, and clear it again when real playback progress resumes. Continue Watching excludes manually completed movies and advances past manually completed episodes. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
361e25d to
4e024e2
Compare
Reuse the detail-page toggle on library movie cards and on every watch history row, with the same completed state and unwatch behaviour. Series cards stay without a single toggle because watched state is per episode. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
A series is watched only when every released episode is watched. Marking it watched completes each released episode from catalogue metadata, skipping specials and unaired episodes; marking it unwatched removes all episode progress for that series. Continue Watching also drops a show whose next episode has not aired. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Apply the same released-episode rules as series: marking a season watched completes only that season's aired episodes, while unwatching removes only that season's progress. The season action appears beside the selected season and hides when there are no released episodes to act on. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Derive one per-season watched map so the tabs, the season action, and the series action share a single source of truth. Completed seasons get a check icon and an accessible "watched" label, making progress scannable without opening every season. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Keep watched/total counts in the shared season progress map so partially watched seasons show a compact count beside the tab label. Complete seasons keep the check, and zero-progress seasons stay unmarked. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Show a compact progress bar and released-episode count beside the series metadata. The summary reads the same season progress map as the tabs, so specials and unaired episodes stay excluded everywhere. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Reuse the released-episode rules from the series page on library cards, with a compact watched count and progress bar. Only shows with completed episodes trigger a catalogue lookup, and metadata failures leave the card unchanged. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Library cards read a stored released-episode total instead of calling the catalogue on every page load. The series page refreshes the total whenever it already has the metadata, so existing entries populate on their next visit while the library stays database-only. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Populate persisted released-episode totals for existing library shows that predate the collection-entry columns. Failures leave entries untouched so a later run can retry them, and the task reports the affected IMDb IDs. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Upstream now resolves the continue target through PlaybackResumeService, while this branch decides watched state per season, episode and series. The merge keeps the resume target for the hero button and layers the watched/series progress values it needs on the same progress rows, and keeps both the series total backfill note and upstream's data-directory note in the README. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@vitobotta ready for a first review and mergeable against current |
vitobotta
left a comment
There was a problem hiding this comment.
First review at 1ced8417, with main merged. The suite is green here: 537 examples, 0 failures, RuboCop clean on thirteen files, and the backfill task runs. No CI checks are reported on the head.
I exercised the paths the specs do not: the series and season actions against a real metadata shape, Continue Watching after a manual movie and episode, a child account marking a season, the library cards with and without a persisted total, and the pages at 1280 and phone width. Those all behave.
Two problems need a fix before merge: a failed metadata load zeroes a stored series total, and undated TBA episodes are counted and marked as released. Details on the lines below. The drawer toggle's history title is a smaller inconsistency.
The rest is in good shape: ownership scoping, the child policy check, the completion policy, the way real playback clears the manual flag, and the no-catalogue library render all behave.
…ed episodes A 500 from Cinemeta zeroed a library card's stored total, and a TBA episode with no air date was counted and marked watched by the season and series actions; the drawer now stores the same label as every other entry point.
|
@vitobotta all three are fixed on the branch.
One consequence worth naming: a show whose episodes all lack air dates now reports
|
vitobotta
left a comment
There was a problem hiding this comment.
Re-reviewed at fa9e26e9. The three findings from the first pass are fixed:
- Blank and unparseable release dates now read as not released in both
SeriesProgressandWatchedToggle; the new examples cover the TBA episode and the count, and the series action skips it. - The drawer toggle now stores the same
Show SxxExxlabel as the player and the series and season actions; the new content example asserts it. - A failed catalogue call no longer persists the 0 total; the new example keeps the stored 62.
One data-loss edge remains and is on the line below. meta_result.success? covers the failed call, but a successful response with an empty episode list still writes 0 over a stored total. I stubbed a 200 with videos: [] on an entry with 62 and the entry went to 0.
The PR is also CONFLICTING with main; merging origin/main conflicts in app/services/playback/continue_watching_query.rb, so a merge or rebase is needed before this can land.
Gates at the head: focused 31/0, full 540/0, JS 528/0, RuboCop clean on the five touched Ruby files.
A 200 with no episodes left the stored series total at 0, the same data loss as a failed call, so the guard now requires episodes to be present.
# Conflicts: # app/services/playback/continue_watching_query.rb
Upstream renamed the successor lookup and made it return the labelled Next struct, so the rebased examples stub next_episode_after with that shape.
|
@vitobotta the empty-success case is covered and the branch now merges
|
vitobotta
left a comment
There was a problem hiding this comment.
The empty-success guard is fixed at 72df706. The controller now requires both a successful metadata call and a present episode list before persisting the total, and the new request example keeps an entry at 62 when a successful response returns no episodes.
The branch still conflicts with current main in db/schema.rb. Main bumps the schema version to 2026_10_30_130000 for the playlists migration, so rebase onto main and keep 2026_10_30_160000 while retaining the playlists tables that main adds.
Gates after a test merge with that resolution: 601 RSpec examples, 0 failures; 578 JavaScript tests, 0 failures; RuboCop 195 files, no offenses; Brakeman clean. The focused watched, content, history and progress specs are 87 examples, 0 failures.
No other findings.
Keep this branch's 2026_10_30_160000 schema version and its completed and series_total_episodes columns, while retaining the playlists tables main adds. The merged schema was checked by migrating an empty database from scratch and comparing the dump, which matches byte for byte.
|
Merged today's main ( Schema resolution — Gates at A rebase was not the right tool for these branches: #43 carried earlier merges of main, so replaying its seven commits re-conflicted each one. A merge produces the same tree your test merge validated, and this branch is the same shape — one conflict, in the schema version line only. |
vitobotta
left a comment
There was a problem hiding this comment.
The four earlier findings are fixed at 7828189. The head is a merge of d0f8cb9 and carries no branch-owned code changes after 72df706, so the verified behavior is unchanged.
Current main has moved past d0f8cb9: #43 is merged, and db/schema.rb is now 2026_11_05_090000 with the app_settings, playlists, and playlist_items tables. The PR is CONFLICTING in db/schema.rb. Merge current main and keep that version, main's three tables, and this branch's completed and series_total_episodes columns.
Gates on a test merge with current main: 670 RSpec examples, 0 failures; 580 JavaScript tests, 0 failures; RuboCop inspected 208 files, no offenses; Brakeman clean. CI passes lint, scan_js, and scan_ruby.
No other findings.
Resolve the schema dump against the merged 2026_11_05_090000 version: keep main's app_settings, playlists and playlist_items tables together with this branch's completed and series_total_episodes columns. Checking the merged file against a migration of an empty database gives an identical dump.
|
Merged current main (
Gates at |
vitobotta
left a comment
There was a problem hiding this comment.
Approved at 608ddf7.
The schema conflict is resolved correctly. The branch keeps 2026_11_05_090000, retains app_settings, playlists, and playlist_items from main, and adds completed plus the two series_total_episodes columns from this branch. I dropped the test database, migrated an empty one through every migration, and the generated schema matched the committed file.
Gates at this head: 670 RSpec examples, 0 failures; 580 JavaScript tests, 0 failures; RuboCop inspected 208 files with no offenses; Brakeman found no warnings. CI passes lint, scan_js, and scan_ruby.
The four earlier findings remain fixed: the total write requires a successful metadata call with a present episode list, blank and unparseable release dates count as not released, the episode drawer uses the shared Show SxxExx title, and the series progress count excludes specials and unaired episodes.
No remaining findings.
|
Thanks @phantomic12 for the watched toggles work. It covers detail pages, library cards, history rows, season tabs, series progress, and the catalogue backfill, with the empty and failed catalogue cases pinned. A new release is coming shortly. |
Summary
Implements backlog item 9, Mark played / unplayed, as its own PR on top of current
main.Movies and episodes can be marked watched from their detail surfaces, library
movie cards, and watch-history rows. Series and individual seasons have
dedicated actions that apply the same released-episode rules. State is stored
on
playback_progresses(completed), so it works even when catalogue metadatahas no runtime.
Behaviour
2/8, with an accessible "2 of 8 episodes watched" label. Zero-progress seasons stay unmarked. Tabs, season action, and series action all read from one per-season progress map.Backlog
This is item 9 in the one-feature-per-PR Jellyfin backlog carried by PR #38.
docs/jellyfin-parity.mdwill need its row updated to done once #38 lands.Migration
Adds
playback_progresses.completed(boolean, default false, not null), pluscollection_entries.series_total_episodesandseries_total_episodes_synced_at.A one-time backfill for existing entries is available with
bin/rails series:backfill_totals. It targets library shows missing a total, leaves failures untouched for retry, and reports the affected IMDb IDs.Testing
RAILS_ENV=test bundle exec rspecwith test encryption and catalogue API variables set on a fresh SQLite test database with the migration applied.media_transcoder_spec.rb,hls_session_manager_spec.rb,hls_spec.rb, andproduction_process_spec.rb, failing onProcess.spawn(pgroup:),/dev/null, and.shentrypoints. No watched/content/library/history spec is among them.