Skip to content

Fix prefix handling in bulk file renamer#563

Open
Zzy-0608 wants to merge 1 commit into
josharsh:masterfrom
Zzy-0608:fix-bulk-file-renamer-prefix
Open

Fix prefix handling in bulk file renamer#563
Zzy-0608 wants to merge 1 commit into
josharsh:masterfrom
Zzy-0608:fix-bulk-file-renamer-prefix

Conversation

@Zzy-0608
Copy link
Copy Markdown

Summary

This PR fixes the prefix handling logic in Bulk File Renamer.

Previously, when a user entered a base filename such as photo, the program generated renamed files like _a.txt instead of the expected photo_a.txt. This happened because the conditional expression did not correctly use the user-provided prefix.

Changes

  • Fixed the filename prefix generation logic.
  • When a base filename is provided, files are renamed using the format prefix_originalName.
  • When no base filename is provided, the existing underscore prefix behavior is preserved.
  • Improved the renaming logic to make the behavior clearer and easier to maintain.

Testing

Tested locally with sample files:

  • a.txt
  • b.txt
  • c.jpg

Using photo as the base filename, the files are renamed as expected:

  • a.txt -> photo_a.txt
  • b.txt -> photo_b.txt
  • c.jpg -> photo_c.jpg

@github-actions github-actions Bot added documentation Improvements or additions to documentation python Pull requests that update Python code labels May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant