Skip to content

Fix slugify leaving a trailing hyphen on long titles - #74

Merged
blixvip merged 1 commit into
blixvip:mainfrom
Aryan7280:fix/50-slugify-trailing-hyphen
Nov 16, 2026
Merged

blixvip merged 1 commit into
blixvip:mainfrom
Aryan7280:fix/50-slugify-trailing-hyphen

Conversation

@Aryan7280

Copy link
Copy Markdown
Contributor

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("Everything Everywhere All at Once Special Edition Directors Cut")
# 'everything-everywhere-all-at-once-special-edition-directors-'

slugify() stripped hyphens before cutting the slug to 60 characters, so a separator right at the cut stayed in. The job still starts, but safe_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 passes safe_job(). It fails on main and passes with this change. The existing slugify tests still pass too.

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.
@blixvip
blixvip merged commit 9920dac into blixvip:main Nov 16, 2026
2 checks passed
@blixvip

blixvip commented Nov 16, 2026

Copy link
Copy Markdown
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.

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.

Keep slugify from ending a job name in a hyphen, which breaks every job API

2 participants