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

Remove excessive punctuation as part of distraction settings #4673

Merged

Conversation

MitchelPaulin
Copy link
Contributor

@MitchelPaulin MitchelPaulin commented Feb 12, 2024

Title

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

close #4268

Description

Filters out excessive use of punctuation consisting of ! and ? if you have the capitalization setting already enabled

Screenshots

Setting ON:

Screenshot from 2024-02-12 17-01-36

Setting OFF:

image

Testing

  • Search gothanchess
  • Search gothanchess what am I for example of ?!?!

Desktop

  • OS: Pop_OS
  • OS Version: 22.04 LTS
  • FreeTube version: 0.19.1

Additional context

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Feb 12, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 12, 2024 22:04
@MitchelPaulin MitchelPaulin changed the title Remove excessive punctuation as part of distractoin settings Remove excessive punctuation as part of distraction settings Feb 12, 2024
static/locales/en-US.yaml Outdated Show resolved Hide resolved
return title.replace(reg, x => capitalizedWord(x.toLowerCase()))
return title
.replaceAll(/!{2,}/g, '!')
.replaceAll(/[!?|]{2,}/g, '?')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why [!?|]{2,} not \?{2,}

Copy link
Contributor Author

@MitchelPaulin MitchelPaulin Feb 12, 2024

Choose a reason for hiding this comment

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

To deal with strings like TITLE???!??!!!!!?

If you only matched ? and ! separately you would end up with TITLE?!?!? rather than TITLE?

Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. /[!?]{2,}/g is enough (without |)
  2. Please provide test case (video) for title with ?!?!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is an example

https://www.youtube.com/watch?v=-SZwcg73BYs

Here is what is looks like filtered

image

Co-authored-by: PikachuEXE <git@pikachuexe.net>
auto-merge was automatically disabled February 12, 2024 23:36

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 12, 2024 23:36
auto-merge was automatically disabled February 13, 2024 02:36

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 13, 2024 02:36
Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Thanks it works great

@FreeTubeBot FreeTubeBot merged commit 8296521 into FreeTubeApp:development Feb 13, 2024
6 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Feb 13, 2024
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Feb 15, 2024
…-user-playlist-2

* development: (66 commits)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Czech)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Estonian)
  Translated using Weblate (Turkish)
  Translated using Weblate (Spanish)
  Translated using Weblate (Arabic)
  Translated using Weblate (Italian)
  Translated using Weblate (Polish)
  Translated using Weblate (French)
  Translated using Weblate (Chinese (Traditional))
  Translated using Weblate (Chinese (Simplified))
  Fix overflow issue with share playlist icon drop-down (FreeTubeApp#4677)
  Fix the Invidious DASH manifest generation (FreeTubeApp#4672)
  Hide channel sidebar label under `more` when setting is enabled (FreeTubeApp#4678)
  Translated using Weblate (Norwegian Nynorsk)
  Translated using Weblate (Serbian)
  Remove excessive punctuation as part of distraction settings (FreeTubeApp#4673)
  Bump the stylelint group with 1 update (FreeTubeApp#4669)
  Bump swiper from 11.0.5 to 11.0.6 (FreeTubeApp#4670)
  ...

# Conflicts:
#	src/renderer/components/playlist-info/playlist-info.scss
@redactedscribe
Copy link

Would like to have a way to see the original title before any DeArrowing of the title if possible, essentially: #3900

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.

[Feature Request]: Remove excessive punctuation from video titles
6 participants