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

(Fix) Replace dots with spaces in upload title #1188

Merged
merged 1 commit into from
Mar 1, 2020
Merged

(Fix) Replace dots with spaces in upload title #1188

merged 1 commit into from
Mar 1, 2020

Conversation

werrpy
Copy link
Contributor

@werrpy werrpy commented Mar 1, 2020

This fixes issues with replacing dots with spaces in upload title. It keeps dots between H.264, and audio channel (ex. FLAC 2.0).

You can test it here: https://regex101.com/r/tz9esE/2/
In the test string add some titles, one per line. In the substitution drop down set it to a single space character.

This replaces dots with spaces that are between:

  1. letter and letter
  2. number and letter
  3. . 4 numbers (.year)
  4. 4 numbers and 3 or 4 numbers followed by i or p (year and resolution, 2020.1080p)
  5. S . 2 numbers . 3 or 4 numbers followed by i or p (season and resolution, S01.720p)
  6. 2 letters . number . number (DD.2.0 or AAC.2.0 or DD+.2.0 or DTS-X.7.1)

Each of the cases is separated by a vertical bar | (aka "OR") in the regex
"Letter" here means any non-digit
Cases 4 and 5 are actually only needed for 720p, since Case 3 already handles removing a dot before four numbers (ex. .2020 is same as .1080), but I think including 1080 (4 numbers) here makes it more robust.

@codecov
Copy link

codecov bot commented Mar 1, 2020

Codecov Report

Merging #1188 into master will increase coverage by 0.31%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1188      +/-   ##
============================================
+ Coverage     23.35%   23.66%   +0.31%     
  Complexity     4140     4140              
============================================
  Files           296      296              
  Lines         13109    13109              
============================================
+ Hits           3061     3102      +41     
+ Misses        10048    10007      -41     
Impacted Files Coverage Δ Complexity Δ
app/Services/Clients/TmdbClient.php 48.38% <0.00%> (-3.23%) 89.00% <0.00%> (ø%)
app/Models/User.php 34.12% <0.00%> (-2.39%) 122.00% <0.00%> (ø%)
app/Http/Controllers/AnnounceController.php 46.30% <0.00%> (ø) 65.00% <0.00%> (ø%) ⬆️
app/Http/Controllers/BonusController.php 89.33% <0.00%> (+0.26%) 52.00% <0.00%> (ø%) ⬆️
app/Repositories/ChatRepository.php 71.25% <0.00%> (+3.59%) 47.00% <0.00%> (ø%) ⬆️
app/Http/Controllers/API/TorrentController.php 72.63% <0.00%> (+4.47%) 83.00% <0.00%> (ø%) ⬆️
app/Models/Torrent.php 28.98% <0.00%> (+13.04%) 31.00% <0.00%> (ø%) ⬆️
app/Helpers/TorrentHelper.php 30.00% <0.00%> (+30.00%) 10.00% <0.00%> (ø%) ⬆️
app/Models/BonTransactions.php 33.33% <0.00%> (+33.33%) 3.00% <0.00%> (ø%) ⬆️
app/Notifications/NewBon.php 100.00% <0.00%> (+100.00%) 3.00% <0.00%> (ø%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6711671...3edcc96. Read the comment docs.

@HDVinnie
Copy link
Collaborator

HDVinnie commented Mar 1, 2020

thanks @werrpy

@HDVinnie HDVinnie merged commit 3eda413 into HDInnovations:master Mar 1, 2020
HDVinnie added a commit that referenced this pull request Mar 3, 2020
- PR #1188 and #1196 were not compadable with safari and chrome
@werrpy werrpy mentioned this pull request May 19, 2020
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