Skip to content

add import option for Netflix watch history#1213

Open
4ndriH wants to merge 4 commits intoFuzzyGrim:devfrom
4ndriH:netflix-watch-history
Open

add import option for Netflix watch history#1213
4ndriH wants to merge 4 commits intoFuzzyGrim:devfrom
4ndriH:netflix-watch-history

Conversation

@4ndriH
Copy link
Copy Markdown

@4ndriH 4ndriH commented Feb 18, 2026

This adds an import option for the Netflix watch history CSV.
The CSV only provides names of the media watched, which has to be matched against TMDb. The matching process currently looks for exact matches which could be improved by utilizing something like min edit distance in the future. I am pointing this out because Netflix does sometimes have small discrepancies when it comes to episode names.
For example the episodes of the tv show Blacklist can additionally contain a number on Netflix, indicating where the blacklister is on Reddingtons list.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @4ndriH, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant new integration, allowing users to import their Netflix watch history. By processing CSV files exported from Netflix, the system can now automatically identify and log watched movies and TV series, including specific seasons and episodes, by matching them against TMDb. This enhances the platform's ability to provide a comprehensive tracking solution for user media consumption.

Highlights

  • New Netflix Watch History Import: Introduced a new feature allowing users to import their Netflix watch history from a CSV file, enabling tracking of watched movies and TV shows.
  • TMDb Matching Logic: Implemented logic to parse Netflix CSV titles and match them against TMDb for accurate media identification, handling various title formats including season and episode details.
  • Current Matching Limitations: The initial implementation uses exact title matching, with a note that future improvements could include fuzzy matching (e.g., min edit distance) to better handle minor discrepancies in Netflix episode names.
  • Comprehensive Media Tracking: The importer creates database entries for movies, TV series, individual seasons, and episodes, including their watched dates and completion statuses.
Changelog
  • src/integrations/imports/netflix.py
    • Added a new Python module containing the core logic for parsing Netflix watch history CSVs, matching titles to TMDb, and preparing data for database insertion.
  • src/integrations/tasks.py
    • Updated to include the new netflix module and registered a Celery task import_netflix to handle asynchronous processing of Netflix CSV imports.
  • src/integrations/tests/imports/test_netflix.py
    • Added unit tests for the NetflixImporter class, covering various scenarios such as movie and TV show imports, date parsing, and series completion status determination.
  • src/integrations/tests/mock_data/import_netflix.csv
    • Added a sample CSV file containing mock Netflix watch history data to be used in tests.
  • src/integrations/urls.py
    • Added a new URL pattern /import/netflix to route requests for Netflix watch history imports to the corresponding view function.
  • src/integrations/views.py
    • Added a new view function import_netflix to handle the upload of Netflix watch history CSV files and queue the import task for processing.
  • src/static/img/netflix-logo.svg
    • Added the SVG image file for the Netflix logo, to be used in the user interface.
  • src/templates/users/import_data.html
    • Updated the import data template to include a new section for Netflix import, providing a user interface element for uploading CSV files.
  • src/users/models.py
    • Updated the get_import_tasks method in the user model to include 'netflix' as a recognized import source.
  • src/users/templatetags/user_tags.py
    • Added Netflix to the SOURCE_INFO dictionary, enabling the display of its name and logo in the application's UI.
Activity
  • No explicit activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new importer for Netflix watch history from a CSV file. While a great addition, it has potential Denial of Service (DoS) vulnerabilities. Specifically, handling large CSV files by reading the entire file into memory and performing unbounded external API calls and database operations per row can lead to resource exhaustion. Recommendations include implementing streaming file processing and limiting the number of entries processed per task. Additionally, consider improving error handling for resilience, fixing error message formatting, and refactoring for better code clarity and efficiency.

@4ndriH 4ndriH changed the title Netflix watch history add import option for Netflix watch history Mar 10, 2026
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.

1 participant