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

Add PRE-HDRip to SCR quality & Replace Multi Spaces with Single in title #11

Closed
wants to merge 2 commits into from

Conversation

mhdzumair
Copy link
Contributor

@mhdzumair mhdzumair commented Jul 26, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced the media quality parser to recognize "P-HD" and "P-DVD" formats.
    • Improved title cleaning functionality to handle multiple consecutive spaces.
  • Bug Fixes

    • Simplified the UFC 247 title entry by removing "PPV" designation for improved accuracy.
  • Refactor

    • Reformatted test parameterization for enhanced readability in multiple test files.

Copy link

coderabbitai bot commented Jul 26, 2024

Walkthrough

The recent updates enhance the functionality of the media quality parser and title cleaning processes. The add_defaults function now recognizes new media formats, while the clean_title function has been improved to normalize spacing in titles. Additionally, test files have been reformatted for better readability, ensuring that testing logic remains intact while making it easier for developers to maintain and understand the test cases.

Changes

Files Change Summary
PTT/handlers.py Updated add_defaults to recognize "P-HD" and "P-DVD" formats, mapping them to "SCR". Removed regex for "PreDVD". Enhances quality parsing functionality.
PTT/parse.py Introduced MULTIPLE_SPACES_REGEX to clean up titles by replacing multiple spaces with a single space in the clean_title function, improving title normalization.
tests/test_quality.py Reformatted @pytest.mark.parametrize decorator from single line to multi-line for improved readability, with no change to underlying test logic.
tests/test_sports.py Reformatted @pytest.mark.parametrize decorator for better organization without altering the test functionality.
tests/test_title.py Modified UFC 247 event title from "UFC 247 PPV Jones vs Reyes" to "UFC 247 Jones vs Reyes" to simplify naming convention, with no functional changes.

Poem

🐇 In the land of code, the rabbits play,
With titles cleaned in a tidy way.
Formats recognized, parsing refined,
Quality's bright, no more to unwind.
Hops of joy with every test,
Our code now shines, it’s truly the best! 🌟

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

Copy link

@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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 643ef01 and b528602.

Files selected for processing (5)
  • PTT/handlers.py (2 hunks)
  • PTT/parse.py (2 hunks)
  • tests/test_quality.py (1 hunks)
  • tests/test_sports.py (1 hunks)
  • tests/test_title.py (1 hunks)
Files skipped from review due to trivial changes (3)
  • tests/test_quality.py
  • tests/test_sports.py
  • tests/test_title.py
Additional comments not posted (3)
PTT/parse.py (2)

35-35: LGTM!

The regex pattern r"\s+" correctly matches sequences of whitespace characters.


138-138: LGTM!

The use of MULTIPLE_SPACES_REGEX to replace multiple spaces with a single space enhances the clean_title function's robustness.

PTT/handlers.py (1)

120-120: LGTM!

The regex pattern r"\bP(?:RE)?-?(HD|DVD)(?:Rip)?\b" correctly matches "P-HD" and "P-DVD" formats, and mapping them to "SCR" is appropriate.

@dreulavelle
Copy link
Owner

These changes were implemented a while back. Lots of new things coming I think you'll enjoy! :)

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