-
-
Notifications
You must be signed in to change notification settings - Fork 9
Feat/rename catalog #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…fetching, replacing credential-derived tokens and direct login.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @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 introduces a major overhaul to the application's user authentication and dynamic catalog features. By transitioning to a Stremio-auth-key-only login, it significantly simplifies the user experience and backend logic for managing user identities. The changes also enhance the recommendation system by providing more distinct and configurable 'loved' and 'watched' catalogs, all presented through a refreshed and more interactive user interface. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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 major and beneficial refactoring of the authentication and user management system. It moves away from a custom credential system to one that is tightly integrated with Stremio's authentication, using the Stremio user_id as the primary identifier. This simplifies the user flow, improves security by not storing Stremio credentials, and streamlines the codebase. The frontend has been significantly updated to reflect this new, simpler user experience. My review includes suggestions to improve code clarity, remove dead code, and address a potential runtime error in the JavaScript.
I am having trouble creating individual review comments. Click here to see my feedback.
app/static/script.js (682-687)
This else if block for stremioAuthSection appears to be dead code. The element stremioManualFields and its corresponding logic have been removed in this pull request. Calling document.getElementById('stremioManualFields') will return null, and attempting to access .classList will cause a TypeError.
Since this entire block is now obsolete, it should be removed to prevent potential runtime errors and to clean up the code.
} else {app/api/endpoints/catalogs.py (79)
The chained replace() calls to extract the item_id are a bit fragile and can be made more robust and elegant. A better approach would be to split the string to isolate the ID part, which is less prone to errors if the prefix format changes or if prefixes could theoretically appear in the item ID.
item_id = id.split(".", 2)[-1]
app/api/endpoints/tokens.py (212-221)
This block of code to fetch the Stremio user ID from an auth key is duplicated in create_token, check_stremio_identity, and here in delete_token. To improve maintainability and reduce redundancy, consider extracting this logic into a shared private helper function or a FastAPI dependency.
app/core/constants.py (1)
This new constant RECOMMENDATIONS_CATALOG_NAME is a good addition for maintainability. However, it doesn't appear to be used anywhere in the project. It should be imported and used in app/api/endpoints/manifest.py to replace the hardcoded string "Top Picks for You".
app/services/token_store.py (60-73)
The new methods _encrypt_password and _decrypt_password seem to be unused following the refactoring, as passwords are no longer stored. If they are indeed obsolete, they should be removed to keep the codebase clean.
…fetching, replacing credential-derived tokens and direct login.
* 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)
No description provided.