Repository navigation
Fix slugify leaving a trailing hyphen on long titles - #74
Merged
Merged
Conversation
Fixes blixvip#50. Also resolves blixvip#44. When titles were truncated to 60 characters, a hyphen right at the truncation boundary remained at the end of the slug, causing web.safe_job validation to fail against _SLUG. Stripping hyphens after truncation ensures every generated slug is valid.
Owner
|
Thanks @Aryan7280, this is merged. Long titles no longer leave a trailing hyphen in the job name, so Thumbnail, Log, Stop and Delete work again for those jobs. If you want a next step, good first issue #73: Tell screen readers whether the Options panel is open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #50 (and #44, which is the same bug).
Long movie titles could end up with a slug that ends in a hyphen, like:
slugify()stripped hyphens before cutting the slug to 60 characters, so a separator right at the cut stayed in. The job still starts, butsafe_job()rejects that slug. After that the thumbnail, log, Stop and Delete all fail with "unknown edit".The fix strips hyphens again after truncating. The
edit-<hash>fallback for empty slugs works the same as before.I added a test that runs a couple of long titles through
slugify()and checks the result passessafe_job(). It fails on main and passes with this change. The existing slugify tests still pass too.