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

Some Possible Updates #8612

Merged
merged 6 commits into from
Nov 4, 2023
Merged

Some Possible Updates #8612

merged 6 commits into from
Nov 4, 2023

Conversation

BKSteve
Copy link
Collaborator

@BKSteve BKSteve commented Nov 4, 2023

PyCharm error list.
Going through some items and clearing errors and warnings.

Reject, comment, accept, open house.

Summary by CodeRabbit

  • Refactor
    • Improved thread handling in certain classes for better performance.
    • Updated URL parsing method in the Client class for more accurate host and port extraction.
  • Chores
    • Removed unused validators module imports across multiple provider files.
    • Updated type imports in tv.py for better type checking.

Copy link
Contributor

coderabbitai bot commented Nov 4, 2023

Walkthrough

The changes in the SickChill project involve various modifications across different files. The main changes include altering the way daemon threads are set in two files, updating URL parsing in the qbittorrent client, removing the import statement for the validators module in multiple provider files, and switching the import source for the Union type in the tv.py file.

Changes

File(s) Summary
sickchill/adba/__init__.py, sickchill/adba/aniDBlink.py Changed the way daemon threads are set from self.setDaemon(True) to self.daemon = True.
sickchill/oldbeard/clients/qbittorrent.py Updated URL parsing from from urllib.parse import splitport to from urllib.parse import urlparse. Adjusted the assignment of self.host and self.port.
sickchill/oldbeard/providers/bitcannon.py,
sickchill/oldbeard/providers/iptorrents.py,
sickchill/oldbeard/providers/kat.py,
sickchill/oldbeard/providers/magnetdl.py,
sickchill/oldbeard/providers/nyaa.py,
sickchill/oldbeard/providers/skytorrents.py,
sickchill/oldbeard/providers/torrentday.py,
sickchill/oldbeard/providers/torrentproject.py,
sickchill/oldbeard/providers/yggtorrent.py,
sickchill/providers/torrent/FrenchProvider.py
Removed the import statement for the validators module.
sickchill/tv.py Switched the import source for the Union type from typing_extensions to typing.

Poem

🍂 As autumn leaves fall, so do old ways, 🍁

In the land of code, where the rabbit plays. 🐇💻

Daemon threads set anew, URL parsing too, 🌐

Validators gone, as the wind blew. 🌬️

Union type finds a new home, 🏠

In the vast code forest where we roam. 🌲🌳

Celebrate the change, embrace the new, 🎉

For in the world of code, there's always something to do! 💡


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

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

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 2f55ab9 and 1d06800.
Files selected for processing (14)
  • sickchill/adba/init.py (1 hunks)
  • sickchill/adba/aniDBlink.py (1 hunks)
  • sickchill/oldbeard/clients/qbittorrent.py (2 hunks)
  • sickchill/oldbeard/providers/bitcannon.py (1 hunks)
  • sickchill/oldbeard/providers/iptorrents.py (1 hunks)
  • sickchill/oldbeard/providers/kat.py (1 hunks)
  • sickchill/oldbeard/providers/magnetdl.py (1 hunks)
  • sickchill/oldbeard/providers/nyaa.py (1 hunks)
  • sickchill/oldbeard/providers/skytorrents.py (1 hunks)
  • sickchill/oldbeard/providers/torrentday.py (1 hunks)
  • sickchill/oldbeard/providers/torrentproject.py (1 hunks)
  • sickchill/oldbeard/providers/yggtorrent.py (1 hunks)
  • sickchill/providers/torrent/FrenchProvider.py (1 hunks)
  • sickchill/tv.py (1 hunks)
Files skipped from review due to trivial changes (12)
  • sickchill/adba/init.py
  • sickchill/adba/aniDBlink.py
  • sickchill/oldbeard/providers/bitcannon.py
  • sickchill/oldbeard/providers/iptorrents.py
  • sickchill/oldbeard/providers/kat.py
  • sickchill/oldbeard/providers/magnetdl.py
  • sickchill/oldbeard/providers/nyaa.py
  • sickchill/oldbeard/providers/skytorrents.py
  • sickchill/oldbeard/providers/torrentday.py
  • sickchill/oldbeard/providers/torrentproject.py
  • sickchill/oldbeard/providers/yggtorrent.py
  • sickchill/providers/torrent/FrenchProvider.py
Additional comments: 2
sickchill/tv.py (1)
  • 12-12: The change from typing_extensions to typing for the Union import is fine as long as the Python version being used is 3.5 or above, as Union was added to the typing module in Python 3.5. If the project is intended to support Python versions below 3.5, this change could cause compatibility issues.
- from typing_extensions import Union
+ from typing import Union
sickchill/oldbeard/clients/qbittorrent.py (1)
  • 2-2: The change from splitport to urlparse is a good one as splitport is not a function in urllib.parse. This change should resolve any issues related to this.

sickchill/oldbeard/clients/qbittorrent.py Outdated 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 1d06800 and b94cc30.
Files selected for processing (1)
  • sickchill/oldbeard/clients/qbittorrent.py (2 hunks)
Additional comments: 2
sickchill/oldbeard/clients/qbittorrent.py (2)
  • 1-5: The import statement has been updated to use urlparse instead of splitport. This change is more flexible as it can handle URLs with or without ports.

  • 13-21: The __init__ method of the Client class has been updated to use urlparse to parse the host URL and extract the host and port. This is a more robust approach as it can handle a wider range of URL formats.

-        host, port = splitport(self.host or settings.TORRENT_HOST)
+        parsed_url = urlparse(self.host or settings.TORRENT_HOST)
+        self.host = parsed_url.hostname
+        self.port = parsed_url.port

@BKSteve
Copy link
Collaborator Author

BKSteve commented Nov 4, 2023

Changed the way daemon threads are set from self.setDaemon(True) to self.daemon = True.

This one is a python 3.8+ as far as I know. Now more 3.7

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 b94cc30 and a60b62d.
Files selected for processing (1)
  • sickchill/oldbeard/clients/download_station.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • sickchill/oldbeard/clients/download_station.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 a60b62d and cc9d3fa.
Files selected for processing (1)
  • sickchill/gui/slick/views/displayShow.mako (1 hunks)
Files skipped from review due to trivial changes (1)
  • sickchill/gui/slick/views/displayShow.mako

@miigotu
Copy link
Contributor

miigotu commented Nov 4, 2023

These are all good, thanks!

@miigotu miigotu merged commit 391ad25 into develop Nov 4, 2023
11 checks passed
@miigotu miigotu deleted the typing branch November 4, 2023 21:51
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