Skip to content
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

root dirs, trakt, addshow, bdecode #8718

Merged
merged 3 commits into from
Feb 18, 2024
Merged

root dirs, trakt, addshow, bdecode #8718

merged 3 commits into from
Feb 18, 2024

Conversation

BKSteve
Copy link
Collaborator

@BKSteve BKSteve commented Feb 18, 2024

Fixes

  • rootDir reference numbering (must have come with the js) aligns with actual position of full list no longer needing +1, removes startup error if only one entry
  • trakt interaction and data sharing
  • addshow bunch of cleans and trakt link.
  • torrent_bdecode b"info not found so change to "info"

Summary by CodeRabbit

  • Refactor
    • Updated the traktChecker class to enhance the show tracking process without requiring a force update.
    • Improved show search and addition flow by streamlining parameter handling and variable naming.
    • Corrected video root directory assignment in server settings for accurate path configuration.

Copy link
Contributor

coderabbitai bot commented Feb 18, 2024

Walkthrough

These changes enhance the codebase by simplifying method signatures, internalizing arguments, and improving efficiency and readability when interacting with external services and configurations. The focus is on streamlining show management, adding and fetching trending shows, and initializing server settings.

Changes

File Path Change Summary
.../oldbeard/traktChecker.py
.../views/manage/add_shows.py
.../oldbeard/clients/generic.py
Removed force parameter from run method; updated show existence check in _add_shows_to_trakt_watchlist. Updated methods to handle arguments internally, simplified variable names, and removed unnecessary arguments. Switched from b"info" to "info" in _get_torrent_hash.
.../views/server_settings.py Corrected self.video_root assignment in __init__ method by fixing index access.

🐰✨

In the land of code, where the rabbits play,
Changes were made, to brighten the day.
No more clutter, or needless fray,
Just cleaner paths, for SickChill's way.
🌟📺
With every hop, and every tweak,
Our code now sings, no longer meek!
🐾💻

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 6fa4f33 and f1bdf31.
Files selected for processing (3)
  • sickchill/oldbeard/traktChecker.py (2 hunks)
  • sickchill/views/manage/add_shows.py (5 hunks)
  • sickchill/views/server_settings.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • sickchill/views/server_settings.py
Additional comments: 5
sickchill/views/manage/add_shows.py (4)
  • 43-47: The method searchIndexersForShowName has been modified to handle search_term internally by retrieving it from the body of the request. This change simplifies the method's interface by removing the need for external argument passing. However, ensure that all calls to this method have been updated accordingly to reflect this change.
Verification successful

The verification process confirms that the method searchIndexersForShowName in add_shows.py is not called with any arguments throughout the codebase. This aligns with the changes made to the method to internally retrieve the search_term from the request body, indicating that there is no need for concern regarding the update of calls to this method.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for occurrences of `searchIndexersForShowName` to ensure no arguments are passed.
rg "searchIndexersForShowName\(" --type py

Length of output: 121

* 114-114: The `massAddTable` method no longer accepts `rootDir` as an argument and instead retrieves it from the query parameters. This change aligns with the objective of simplifying method interfaces. Similar to the previous comment, verify that all invocations of `massAddTable` have been updated to not pass `rootDir` as an argument.
Verification successful

Given the search results, which only show the definition of massAddTable without any direct invocations passing arguments, it appears that the method's interface change has been correctly handled across the codebase. This suggests that all necessary updates to method invocations have been made in alignment with the objective of simplifying method interfaces. However, it's important to note that this verification covers direct invocations and might not capture dynamic or indirect method calls, which are common in web applications. Based on the provided evidence, the review comment's concern seems to have been addressed.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for occurrences of `massAddTable` to ensure no arguments are passed.
rg "massAddTable\(" --type py

Length of output: 95

* 242-242: The `trendingShows` method has been updated to no longer accept `traktList` as an argument, instead retrieving it from the query parameters. This change is consistent with the PR's objective to streamline parameter handling. Ensure that the frontend or any API calls to this method have been updated to reflect this change.
Verification successful

The verification process supports the review comment's claim that the trendingShows method has been updated to no longer accept traktList as an argument, instead retrieving it from the query parameters. The search did not find any calls to this method passing arguments, which suggests that the frontend or any API calls to this method have been updated accordingly. However, it's important to note that this verification is based on static analysis and may not capture dynamic or indirect method calls.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for occurrences of `trendingShows` to ensure no arguments are passed.
rg "trendingShows\(" --type py

Length of output: 97



Script:

#!/bin/bash
# Search for calls to `trendingShows` method to ensure no arguments are being passed.
rg "trendingShows\(" --type py

Length of output: 97

* 269-269: The `getTrendingShows` method has been updated similarly to `trendingShows`, with `traktList` now being retrieved from the query parameters instead of being passed as an argument. This modification enhances consistency in how parameters are handled across methods. As with previous changes, verify that all calls to `getTrendingShows` have been updated accordingly.
Verification successful

Based on the script's output, it appears that the getTrendingShows method is defined without accepting any arguments, and there are no calls to this method with arguments within the codebase. This aligns with the modifications mentioned in the review comment, ensuring consistency in how parameters are handled across methods. Therefore, it can be concluded that the changes to getTrendingShows have been correctly implemented.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for occurrences of `getTrendingShows` to ensure no arguments are passed.
rg "getTrendingShows\(" --type py

Length of output: 103

sickchill/oldbeard/traktChecker.py (1)
  • 24-24: The removal of the force parameter from the run method simplifies the method signature. However, ensure that all calls to this method throughout the codebase have been updated to reflect this change. If the force parameter was previously used to control the execution flow within run, consider verifying that its removal does not affect the intended functionality.

sickchill/oldbeard/traktChecker.py Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f1bdf31 and 2866a7a.
Files selected for processing (2)
  • sickchill/oldbeard/traktChecker.py (1 hunks)
  • sickchill/views/manage/add_shows.py (6 hunks)
Files skipped from review as they are similar to previous changes (2)
  • sickchill/oldbeard/traktChecker.py
  • sickchill/views/manage/add_shows.py

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2866a7a and c26b338.
Files selected for processing (1)
  • sickchill/oldbeard/clients/generic.py (1 hunks)
Additional comments: 1
sickchill/oldbeard/clients/generic.py (1)
  • 164-164: The change from using b"info" to "info" for accessing the info field in the torrent_bdecode dictionary is correct if the dictionary keys are indeed strings rather than bytes. This adjustment is crucial for ensuring compatibility with the expected data types in Python 3, where strings and bytes are distinct types. However, it's important to verify that all instances where torrent_bdecode is used or populated have been updated to maintain consistency with this change. If there are other places in the codebase where torrent_bdecode is manipulated or accessed, those should also use string keys to avoid key errors.
Verification successful

The verification process confirms that the change from using b"info" to "info" for accessing the info field in the torrent_bdecode dictionary is consistent across the codebase, as there are no other occurrences of torrent_bdecode being accessed or modified. This ensures compatibility with the expected data types in Python 3 and maintains consistency within the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for other occurrences of torrent_bdecode being accessed or modified to ensure consistency.
rg "torrent_bdecode\["

Length of output: 109

@BKSteve BKSteve changed the title root dirs, trakt, addshow root dirs, trakt, addshow, bdecode Feb 18, 2024
@@ -70,7 +70,7 @@ def __init__(self, options=None):
# video root
if settings.ROOT_DIRS:
root_dirs = settings.ROOT_DIRS.split("|")
self.video_root = root_dirs[int(root_dirs[0]) + 1]
self.video_root = root_dirs[int(root_dirs[0])]
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this one? we dont use video_root

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The first directory location no longer stored as 0 but 1 so adding 1 to 1 when only 1 entry errors at startup

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah I was seeing the diff in reverse. That little section needs removed, video_root was a strange thing echelon added at some point where your videos could be watched remotely without a password even, it didn't require authentication. Idk if he was scraping other people's videos or what.

@miigotu miigotu merged commit 3bb209b into develop Feb 18, 2024
11 checks passed
@miigotu miigotu deleted the trakt-add branch February 18, 2024 23:00
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