Repository navigation
Netflix viewing history for household members, counted like Plex - #250
Merged
Merged
Conversation
Settings -> Users -> Netflix history import reads the data export's ViewingActivity.csv (every profile, watched time, bookmark, device; trailers and short starts left out) and a profile's simple CSV (title and day). Each profile is attached to a household member; re-imports add nothing. The plays are watch_history rows with source="netflix", matched onto the library's titles (exact title, else TMDB in English and German; a film takes its Plex plays' key, a series Sonarr's title). Missing episode numbers come from Sonarr's list, else TMDB's season list in both languages. A daily custodian pass links titles that arrive later. The readers that counted episodes only by number now fall back to the episode title (viewing_sessions.episode_id): household protection, the owner's watch line, watch status, comfort replays, series completion. Played time is Netflix's watched time; day-only plays keep out of the clock and sittings. The Plex sync's resume/merge, re-attribution, orphan cleanup, player backfill and the dedupe script leave Netflix rows alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Don's call: a Netflix play counts exactly like a Plex play, just not against Sonarr. The consumers that only understood Plex are adapted.
Import (Settings → Users → Netflix history import)
CONTENT_INTERACTION/ViewingActivity.csv: every profile, start time, watched time, bookmark, device; trailers, previews and starts under 2 min are dropped and counted);NetflixViewingHistory.csv(title + day; the locale date format is inferred from the file's newest-first order).watch_history,source="netflix", stamped at the end like Plex.listened_msholds the watched time (the played time),view_offset_msthe bookmark. Two new columns:source_refanddate_only.Matching onto the library (
services/netflix_match.py)radarr:N) and the library title.plex_item_idstays the episode's own Netflix id.netflix_relink, no network) links titles that arrive in the library after the import.Consumers (from an audit of every watch_history reader)
viewing_sessions.episode_id). This covers:_other_users_watch, needs ≥3 distinct episodes);_owner_watch;watch_status.watched_lookup;played_ms_sql/_estimated_sqluse Netflix's watched time.reattribute_watch_history;cleanup_orphan_watch_history;fill_players;scripts/dedupe_watch_history.py.Not in this PR
genresstays NULL on Netflix rows until enrichment.Tests:
tests/test_netflix_import.py(42). The full battery is green, 262/262.🤖 Generated with Claude Code