Skip to content

feat(files): add command to automatically rename filenames - #51608

Merged
susnux merged 3 commits into
masterfrom
feat/sanitize-filenames-command
May 5, 2025
Merged

feat(files): add command to automatically rename filenames#51608
susnux merged 3 commits into
masterfrom
feat/sanitize-filenames-command

Conversation

@susnux

@susnuxsusnux commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

Summary

Make it easier for admins to rename all files when e.g. enabling Windows compatibility (ref #44963 ).

Checklist

Comment threadapps/files/lib/Command/SanitizeFilenames.php Outdated
@susnux
susnuxforce-pushed the feat/sanitize-filenames-command branch 2 times, most recently from 4343ae9 to 0f0846fCompareApril 4, 2025 17:18
@susnux
susnux marked this pull request as ready for review April 4, 2025 17:19
@susnuxsusnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 4, 2025
@github-project-automationgithub-project-automationBot moved this to 🏗️ In progress in 📁 Files teamApr 4, 2025
@susnuxsusnux added the pending documentation This pull request needs an associated documentation update label Apr 4, 2025
Comment threadapps/files/lib/Command/WindowsCompatibleFilenames.php
Comment threadapps/files/lib/Command/SanitizeFilenames.php
Comment threadapps/files/lib/Command/WindowsCompatibleFilenames.php
@susnuxsusnux self-assigned this Apr 16, 2025
@susnux
susnux requested a review from come-ncApril 16, 2025 13:21
@susnux
susnuxforce-pushed the feat/sanitize-filenames-command branch from 0f0846f to 5f0e99aCompareApril 16, 2025 13:21
Comment threadapps/files/lib/Command/SanitizeFilenames.php Outdated
Comment threadapps/files/lib/Command/SanitizeFilenames.php Outdated
Comment threadapps/files/lib/Command/SanitizeFilenames.php
Comment threadapps/files/lib/Command/SanitizeFilenames.php Outdated
Comment threadapps/files/lib/Command/WindowsCompatibleFilenames.php Outdated
@Rello

Copy link
Copy Markdown
Contributor

Hello @susnux
thank you for this PR. Frank is requesting this for our instance also.

What do you think about a simulation-parameter?
it would be interesting to output the files to be renamed in a test-run first to give the admin an idea bout the scope

@susnux
susnuxforce-pushed the feat/sanitize-filenames-command branch from d2481e2 to 1ec65e7CompareApril 23, 2025 17:51
@susnux

Copy link
Copy Markdown
ContributorAuthor

What do you think about a simulation-parameter?

This is implemented using --dry-run.

@ChristophWurstChristophWurst mentioned this pull request Apr 24, 2025
8 tasks
@susnux
susnuxforce-pushed the feat/sanitize-filenames-command branch from 1ec65e7 to 437349cCompareApril 24, 2025 08:52
@marcelklehr

marcelklehr commented Apr 24, 2025

Copy link
Copy Markdown
Member

Can we please expose the sanitizeName method in OCP? By adding it directly to IFilenameValidator perhaps? This would be very useful for integration apps like integration_google, integration_dropbox etc

@susnuxsusnux removed the pending documentation This pull request needs an associated documentation update label Apr 30, 2025
@susnux

Copy link
Copy Markdown
ContributorAuthor

Can we please expose the sanitizeName method in OCP? By adding it directly to IFilenameValidator perhaps? This would be very useful for integration apps like integration_google, integration_dropbox etc

Yes, but I would like to do that in a follow up to not overload the PR :)
(would directly create a PR after merge).

susnuxand others added 3 commits April 30, 2025 16:32
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…docs
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnuxforce-pushed the feat/sanitize-filenames-command branch from 437349c to 3657c2aCompareApril 30, 2025 14:32
@susnux
susnux requested a review from skjnldsvApril 30, 2025 14:42
@Rello

Rello commented May 5, 2025

Copy link
Copy Markdown
Contributor

Hello,

can you please also backport this to 31?
We are requested to have it on your instance

@susnux
susnux merged commit c668703 into masterMay 5, 2025
@susnux
susnux deleted the feat/sanitize-filenames-command branch May 5, 2025 13:47
@susnux

This comment was marked as resolved.

1 similar comment
@skjnldsv

Copy link
Copy Markdown
Member

/backport to stable31

@susnux

Copy link
Copy Markdown
ContributorAuthor

@Rello

can you please also backport this to 31?

Done and backport adjusted

@sorbaughsorbaugh moved this from 🏗️ In progress to ☑️ Done in 📁 Files teamMay 8, 2025
@nextcloud-botnextcloud-bot mentioned this pull request Aug 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

Automatically renaming old filenames when enforcing windows filenames

6 participants

@susnux@Rello@marcelklehr@skjnldsv@sorbaugh@come-nc