Skip to content

Fix year-month slug for space-separated filenames#26

Merged
ali5ter merged 1 commit into
mainfrom
feature/fix-year-month-slug-space
Apr 13, 2026
Merged

Fix year-month slug for space-separated filenames#26
ali5ter merged 1 commit into
mainfrom
feature/fix-year-month-slug-space

Conversation

@ali5ter
Copy link
Copy Markdown
Owner

@ali5ter ali5ter commented Apr 13, 2026

Summary

  • Expands the year-month slug regex in _SLUG_PATTERNS to accept a space (in addition to _ or -) before the four-digit year.
  • Fixes filenames like Elektor[nonlinear.ir] 1975-02_text.pdf that were causing all months in a year to collapse into a single slug.

Test plan

  • Confirm Elektor[nonlinear.ir] 1975-02_text.pdf now produces slug 1975-02 instead of falling through to a bare-number match.
  • Verify existing filenames with _YYYY-MM and -YYYY-MM separators still produce correct slugs.
  • Run python3 convert.py --analyze --input-dir <collection> against a collection with space-separated filenames and confirm unique per-issue slugs.

🤖 Generated with Claude Code

Allow a space before the year in the year-month slug pattern, so
filenames like "Elektor[nonlinear.ir] 1975-02_text.pdf" are correctly
parsed instead of collapsing all months into a single slug.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ali5ter ali5ter merged commit b3e5a3f into main Apr 13, 2026
1 check passed
@ali5ter ali5ter deleted the feature/fix-year-month-slug-space branch April 13, 2026 12:51
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.

1 participant