Skip to content

Conversation

@TimilsinaBimal
Copy link
Owner

No description provided.

TimilsinaBimal and others added 13 commits December 12, 2025 16:01
* feat: add option to rename, disable, reorder catalogs

* feat: new recommendation system based on weights

* feat: dynamic row generator

* feat: add dynamic row generator with country flag

* feat: add watched.loved row

* feat: new ui with stremio auth button

* feat: add languages selection button in ui for tmdb meta

* feat: add option to enable rpdb api key for posters

* feat: ui improvements

* chore: add vercel app env

* chore: improve recommendation weights and refactor

* chore: remove unnecessary country flags

* add workflows to bump version

* chore: bump version to 1.0.0-rc.1

* chore: bump version to 1.0.0-rc.2

* chore: use redis token from config

* fix: priotrize keywords for row generation than genre

* chore: bump version to v1.0.0-rc.3

* feat: add option to delete account

* refactor: update token deletion API to use DELETE / and implement deep cloning for catalog data in the frontend, removing conditional name handling.

* opt: improve recommendations using larger candidate pool and better similarity methods

* feat: Add genre exclusion UI, store excluded genres in user settings,and apply them during catalog generation (#21)

* feat: Add genre exclusion UI, store excluded genres in user settings, and apply them during catalog generation.

* refactor: simplify filtering recommendations by excluded genres using list comprehension

* refactor: streamline genre exclusion logic for similarity recommendations

* feat: Rework UI into a multi-step setup wizard with account management and section navigation (#22)

* feat: Rework UI into a multi-step setup wizard with Watchly account management and section navigation
* critical: check if user already exists

* refactor: remove disabled class from source code button

* feat: add translation service to translate catalog names to user language (#23)

* feat: add option to rename, enable disable catalogs (#24)

* feat: Implement user ID-based token management and Stremio user info fetching, replacing credential-derived tokens and direct login. (#25)

* refactor: code refactoring and remove legacy code and components (#26)

* feat: add option to rename, enable disable catalogs

* feat: add option to rename, enable disable catalogs

* feat: Implement user ID-based token management and Stremio user info fetching, replacing credential-derived tokens and direct login.

* feat: Implement user ID-based token management and Stremio user info fetching, replacing credential-derived tokens and direct login.

* feat: Refactor token management to use a dedicated token model, remove token salt, and streamline catalog refresh logic.

* feat: Encrypt auth keys in token store and enforce 401 for invalid tokens across endpoints.

* feat: Introduce token redaction utility and apply it to log messages for enhanced security.

* feat: Introduce token redaction utility and apply it to log messages for enhanced security.

* fernet client management

* feat: add migration script to migrate old tokens to new system

* feat: check and only update tokens that are installed from the same system

* opt: give more weight to items watched recently

* docs: add contributing guidelines and acknowledgements

* opt: optimize translation service

* chore: bump version to v1.0.0-rc.6

* feat: add gemini service to generate catalog names (#29)

* Refactor services for improved async handling and error resilience (#30)

* refactor: fetch loved and liked items at once and use that

* Refactor services for improved async handling and error resilience

* chore: bump version to v1.0.0

* feat: better bare row name generation (#32)
…ion logic (#44)

* feat: Enhance TMDBService with trending and top-rated content retrieval

* feat: Add recency preference and genre diversification to recommendation logic

* feat: Refactor TMDBService usage to support language preference across services

* feat: Refactor library item fetching and caching for improved performance and consistency

* feat: Implement caching for language retrieval and refactor auth key encryption

* feat: Add middleware for Redis call tracking and enhance token store with call counting

* chore: bump version to v1.1.0
@vercel
Copy link

vercel bot commented Dec 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
watchly Ready Ready Preview, Comment Dec 15, 2025 7:47am

@gemini-code-assist
Copy link

Summary of Changes

Hello @TimilsinaBimal, 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 represents a substantial update to the application, primarily focusing on enhancing the recommendation engine's intelligence and efficiency. It introduces advanced algorithms for personalized content discovery, optimizes data fetching and caching strategies, and delivers a refreshed user interface for a smoother and more engaging experience. These changes aim to provide users with more relevant and diverse content suggestions while improving the overall responsiveness and stability of the service.

Highlights

  • Recommendation Engine Overhaul: The core recommendation logic has been significantly refactored to improve accuracy, performance, and user experience. This includes new similarity scoring methods, dynamic recency preferences, and freshness injection for trending content.
  • Performance and Caching Improvements: Extensive caching mechanisms have been introduced or enhanced across various services (TMDB, TokenStore, Stremio library fetches) to reduce API calls and improve response times. Redis client management has been optimized with connection pooling and threshold checks.
  • User Interface (UI) Refresh: The web interface has received a visual update with a new dark theme, improved button styles, and enhanced mobile navigation, providing a more modern and responsive user experience.
  • Enhanced User Profile Vectorization: The user taste profile now includes 'topics' derived from content titles, overviews, and keywords, allowing for more nuanced similarity calculations beyond just genres.
  • Configuration and Maintenance: New Redis configuration options for connection management have been added, and the catalog update schedule has been streamlined. The migrate_tokens startup task is now conditional, and API documentation URLs are environment-dependent.
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.

@TimilsinaBimal TimilsinaBimal merged commit dd26f89 into dev Dec 15, 2025
3 of 4 checks passed
@TimilsinaBimal TimilsinaBimal deleted the merge-conflict branch December 15, 2025 07:47
Copy link

@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 significant enhancements to the recommendation engine, API caching, and UI/UX. Key changes include optimizing RecommendationService by pre-fetching library data and passing it down, refactoring catalog fetching into build_dynamic_catalogs, and implementing alru_cache for TMDB language data to reduce API calls. The application's startup now conditionally runs token migrations based on a hardcoded hostname (which a reviewer suggested changing to an environment variable for flexibility). A new HTTP middleware was added for IP-based rate limiting on missing tokens, and Redis client management was improved with connection limits and a shutdown hook. The recommendation logic was refined with a new topics vector in user profiles, a simplified similarity calculation using Jaccard overlap, and dynamic recency weighting. Discovery queries are now more efficient, fetching multiple pages only if the initial pool is thin, and a 'freshness injection' mechanism adds trending content. Genre filtering was enhanced with a user-specific top-genre whitelist, which a reviewer noted might be overly restrictive for 'Animation' genre ID 16. The UI received a visual refresh with updated Tailwind CSS classes for a modern dark theme, mobile navigation support, and a direct link for donations instead of a modal. Several try...except Exception: pass blocks were used in the new middleware, which a reviewer pointed out could silently swallow errors and suggested more specific error handling or logging.

I am having trouble creating individual review comments. Click here to see my feedback.

app/core/app.py (44)

medium

The condition to run migrate_tokens() is based on a hardcoded hostname. This makes the code less portable and harder to configure for different environments. It's better to control this behavior with an environment variable for greater flexibility.

    if settings.RUN_MIGRATIONS_ON_STARTUP:

app/core/app.py (109-121)

medium

The try...except Exception: pass blocks in the middleware are too broad and will silently swallow any exceptions that occur within them. This can make debugging very difficult if an unexpected error happens. It's better to catch more specific exceptions or at least log the error if a general Exception is caught.

    try:
        # If token is known-missing, short-circuit and track IP failures
        if seg and seg in token_store._missing_tokens:
            ip = request.client.host if request.client else "unknown"
            try:
                _ip_failure_cache[ip] = _ip_failure_cache.get(ip, 0) + 1
            except Exception as e:
                logger.warning(f"Failed to update IP failure cache for {ip}: {e}")
            if _ip_failure_cache.get(ip, 0) > _IP_FAILURE_THRESHOLD:
                return HTMLResponse(content="Too many requests", status_code=429)
            return HTMLResponse(content="Invalid token", status_code=401)
    except Exception as e:
        logger.error(f"Error in block_missing_token_middleware: {e}", exc_info=True)

app/services/recommendation_service.py (281-290)

medium

The special handling for the Animation genre (ID 16) seems overly restrictive. This rule will filter out any animation if it's not in the user's top 5 genres, which could prevent discovery for users who enjoy animation but don't watch it frequently enough for it to be a top genre. It might be better to treat all genres equally in this filter to ensure more consistent behavior.

    async def _passes_top_genre(self, genre_ids: list[int] | None, content_type: str) -> bool:
        whitelist = await self._get_top_genre_whitelist(content_type)
        if not whitelist:
            return True
        gids = set(genre_ids or [])
        if not gids:
            return True
        return bool(gids & whitelist)

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.

2 participants