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

Fixes for Jackett support #8711

Merged
merged 7 commits into from
Feb 12, 2024
Merged

Fixes for Jackett support #8711

merged 7 commits into from
Feb 12, 2024

Conversation

dgburr
Copy link
Contributor

@dgburr dgburr commented Feb 10, 2024

  1. Perform sanity checking on response.next.url (i.e. new proposed value) instead of self.url (i.e. current value)
  2. Pass provider and url to the SearchResult constructor since these values are needed by is_torrent. This is needed since is_torrent gets called immediately after the object is constructed, but before all of the fields have been populated.

Summary by CodeRabbit

  • New Features
    • Enhanced search result handling across the application by including provider information and direct URLs in search results.
  • Refactor
    • Updated methods in various classes and files to support the passing of additional parameters (provider and url) to improve search result accuracy and relevance.
    • Standardized the initialization of search result objects to include provider and URL data, ensuring consistency across different types of search results (NZB, Torrent).

Copy link
Contributor

coderabbitai bot commented Feb 10, 2024

Walkthrough

The recent updates across various components of the SickChill project focus on refining the handling of search results by incorporating provider and url parameters more effectively. This adjustment streamlines the process of fetching and utilizing search results, ensuring that the relevant data is passed and utilized consistently across different parts of the application, particularly in the creation and retrieval of search results.

Changes

Files Summary
sickchill/providers/GenericProvider.py, sickchill/providers/torrent/TorrentProvider.py Changes in GenericProvider.py and TorrentProvider.py to include url parameter in methods for setting and retrieving search results.
sickchill/oldbeard/properFinder.py, sickchill/oldbeard/tvcache.py Modifications in properFinder.py and tvcache.py to pass url as an argument to the get_result method, affecting how search results are handled within these components.
sickchill/oldbeard/classes.py Updates in SearchResult and its subclasses to include provider and url parameters in the initialization process for better data management.

Poem

In the realm of code, where functions intertwine,
Data teams clash, algorithms align.
🏈 Chiefs and 49ers, in digital shrine,
Victory in bits, a symphony divine.

Like a quarterback's throw, precise and keen,
We pass data smoothly, in this coding scene.
In this game of bytes, where bugs convene,
A win on the screen, our code pristine.

🐰🏆🎉

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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fc40d49 and 9d5393e.
Files selected for processing (6)
  • sickchill/oldbeard/classes.py (5 hunks)
  • sickchill/oldbeard/properFinder.py (1 hunks)
  • sickchill/oldbeard/tvcache.py (1 hunks)
  • sickchill/providers/GenericProvider.py (3 hunks)
  • sickchill/providers/nzb/NZBProvider.py (1 hunks)
  • sickchill/providers/torrent/TorrentProvider.py (1 hunks)
Additional comments: 12
sickchill/providers/nzb/NZBProvider.py (1)
  • 18-19: Changes to the _get_result method correctly implement the intended functionality by enhancing the information it can process and utilize. This aligns with the PR objectives.
sickchill/providers/torrent/TorrentProvider.py (1)
  • 58-59: Changes to the _get_result method correctly implement the intended functionality by passing provider and url directly to the TorrentSearchResult constructor. This enhances the robustness of the application.
sickchill/oldbeard/classes.py (6)
  • 21-22: Adding provider and url as parameters to the SearchResult constructor aligns with the PR objectives and improves the initialization of search result objects.
  • 28-28: Initializing the url attribute in the SearchResult constructor enhances URL handling within the application.
  • 89-89: The update to the __check_url method correctly references response.next.url, improving URL handling.
  • 145-146: Adding provider and url as parameters to the NZBSearchResult constructor is consistent with the PR objectives and enhances object initialization.
  • 155-156: Adding provider and url as parameters to the NZBDataSearchResult constructor is consistent with the PR objectives and enhances object initialization.
  • 165-166: Adding provider and url as parameters to the TorrentSearchResult constructor is consistent with the PR objectives and enhances object initialization.
sickchill/oldbeard/properFinder.py (1)
  • 228-228: Passing url directly to the get_result method in the _download_propers function aligns with the PR objectives and enhances URL handling within the application.
sickchill/oldbeard/tvcache.py (1)
  • 492-492: Passing url directly to the get_result method in the find_needed_episodes function aligns with the PR objectives and enhances URL handling within the application.
sickchill/providers/GenericProvider.py (2)
  • 337-338: The method get_result now takes an additional url parameter and directly calls _get_result with episodes, self, and url. Ensure all calls to get_result throughout the codebase have been updated to include the new url parameter.
Verification successful

The verification process, based on the provided shell script outputs, indicates that the get_result method has been updated across the codebase to include the new url parameter as required. Calls to this method in various files (GenericProvider.py, TorrentProvider.py, tvcache.py, and properFinder.py) have been identified, suggesting that the necessary updates have been made to accommodate the new method signature. While the ast-grep commands did not yield explicit results, the direct evidence from the rg command supports the conclusion that the codebase adheres to the updated method signature.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search to find files that call `get_result` method. Expecting list of dependent files.
rg --type py 'get_result\('
# Search old signature to find omissions. Expecting no results.
ast-grep --lang python --pattern $'get_result($_, $_)'
# Search new signature to validate usage. Expecting list of locations where the new signature is used.
ast-grep --lang python --pattern $'get_result($_, $_, $_)'

Length of output: 905

* 409-410: The `_get_result` method now accepts `episodes`, `provider`, and `url` parameters, returning a `SearchResult` object initialized with these parameters. This change aligns with the objective of passing `provider` and `url` directly to the `SearchResult` constructor. Ensure that the `SearchResult` class constructor has been appropriately modified to accept these new parameters.

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 9d5393e and f814dcb.
Files selected for processing (1)
  • sickchill/oldbeard/classes.py (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • sickchill/oldbeard/classes.py

@BKSteve BKSteve changed the base branch from master to develop February 10, 2024 06:19
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 f814dcb and 3ca8557.
Files selected for processing (2)
  • sickchill/providers/GenericProvider.py (3 hunks)
  • sickchill/providers/torrent/TorrentProvider.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • sickchill/providers/GenericProvider.py
  • sickchill/providers/torrent/TorrentProvider.py

Copy link

gitguardian bot commented Feb 10, 2024

⚠️ GitGuardian has uncovered 7 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- Generic High Entropy Secret 3ca8557 sickchill/settings.py View secret
- Generic High Entropy Secret de7c45e sickchill/settings.py View secret
- Generic High Entropy Secret 3ca8557 sickchill/settings.py View secret
- Generic High Entropy Secret de7c45e sickchill/settings.py View secret
- Generic Password d65171f sickchill/oldbeard/subtitles.py View secret
- Generic High Entropy Secret 3ca8557 sickchill/settings.py View secret
- Generic High Entropy Secret de7c45e sickchill/settings.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

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 3ca8557 and de7c45e.
Files selected for processing (1)
  • sickchill/oldbeard/properFinder.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • sickchill/oldbeard/properFinder.py

@BKSteve
Copy link
Collaborator

BKSteve commented Feb 11, 2024

You want to have a go at this https://discord.com/channels/502612977271439372/1130872184701730866 ?

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 de7c45e and d65171f.
Files selected for processing (5)
  • sickchill/oldbeard/classes.py (7 hunks)
  • sickchill/oldbeard/properFinder.py (1 hunks)
  • sickchill/oldbeard/tvcache.py (1 hunks)
  • sickchill/providers/GenericProvider.py (3 hunks)
  • sickchill/providers/torrent/TorrentProvider.py (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • sickchill/oldbeard/classes.py
  • sickchill/oldbeard/properFinder.py
  • sickchill/oldbeard/tvcache.py
  • sickchill/providers/GenericProvider.py
  • sickchill/providers/torrent/TorrentProvider.py

@miigotu miigotu merged commit 053d0e6 into SickChill:develop Feb 12, 2024
1 check passed
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.

3 participants