Skip to content

PICARD-2496: Add option to skip moving files if destination already exists#3093

Open
iron-prog wants to merge 2 commits intometabrainz:masterfrom
iron-prog:picard-2496-clean
Open

PICARD-2496: Add option to skip moving files if destination already exists#3093
iron-prog wants to merge 2 commits intometabrainz:masterfrom
iron-prog:picard-2496-clean

Conversation

@iron-prog
Copy link
Contributor

@iron-prog iron-prog commented Mar 16, 2026

Summary

This PR introduces a new option allowing Picard to skip moving files if the destination file already exists.

New option:
"Skip moving files if destination already exists"

Location:
Options → File Naming → Move files when saving

Behavior priority:

  1. Skip move if destination exists (new option)
  2. Overwrite existing files
  3. Rename with (1), (2) suffix
  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:
    Adds a new configuration option allowing Picard to skip moving files if a file with the same name already exists in the destination directory.

Problem

When moving files during tagging, Picard currently either renames the file by adding a numbered suffix (e.g., (1)) or overwrites the existing file depending on user settings.
Some users prefer to leave the file untouched if a file with the same name already exists in the destination directory.

Solution

This PR introduces a new setting move_skip_existing_files.

If enabled, Picard checks whether the destination file already exists before moving a file.
If it does exist, the move operation is skipped and the file remains in its original location.

Implementation details:

  • Added a new BoolOption (move_skip_existing_files) in options.py
  • Updated the file renaming logic in picard/file.py to skip the move when the option is enabled
  • Added a checkbox to the File Naming → Move files when saving options page
  • Ensured mutual exclusivity with the existing Overwrite existing files option to avoid conflicting behavior

Default behavior remains unchanged if the option is disabled.

AI Usage

In accordance with the AI use policy portion of the MetaBrainz Contribution Guidelines, the level of AI/LLM use in the development of this Pull Request is:

  • No AI/LLM use
  • Minimal use (e.g. autocompletion)
  • Moderate use (e.g. suggestions regarding code fragments)
  • Significant use (e.g. code structure, tests development, etc.)
  • Primarily AI developed
  • Other (please specify below)

Action

Additional actions required:

  • Update Picard documentation (please include a reference to this PR)
  • Other (please specify below)

Copy link
Collaborator

@rdswift rdswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed this in great depth to try to understand whether it is actually necessary or if this is the best solution. If it is necessary and appropriate, the documentation will absolutely need to be updated to explain the new configuration setting, but I see that you have indicated that there are no documentation changes required.

I may be wrong, but I suspect that the AI Usage in developing this PR is actually higher than you indicated.

Comment on lines 1 to 6
# Form implementation generated from reading ui file 'ui/options_renaming.ui'
#
# Created by: PyQt6 UI code generator 6.9.1
#
# Automatically generated - do not edit.
# Use `python setup.py build_ui` to update it.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes made in this file should be made in the ui/options_renaming.ui file (and the file regenerated using python setup.py build_ui), so that they are not lost when the ui files are regenerated in the future.

I guess your AI agent doesn't read the instructions in the file headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI was used for discussion about implementation approach,
UI integration, and preparing the PR description.
All code was manually reviewed and tested(not regressively but at a significant level).

@rdswift
Copy link
Collaborator

rdswift commented Mar 16, 2026

For clarity for the users, perhaps there could be (mutually exclusive) radio buttons for the three options:

  • Do not move duplicate files
  • Move and rename file with numeric suffix
  • Move and overwrite existing files

That way the preference could be stored in a single setting, rather than multiple binary settings relying on code to maintain their mutual exclusivity.

@iron-prog
Copy link
Contributor Author

thanks for this suggestion it's my bad for relying on ai

@rdswift
Copy link
Collaborator

rdswift commented Mar 16, 2026

thanks for this suggestion it's my bad for relying on ai

This was a suggestion only, based on my initial cursory review. Others may have different opinions and different suggested preferences. I would wait until at least @phw and @zas have had a chance to comment before making any changes.

@rdswift rdswift requested review from phw and zas March 16, 2026 16:57
@zas
Copy link
Collaborator

zas commented Mar 18, 2026

For clarity for the users, perhaps there could be (mutually exclusive) radio buttons for the three options:

* Do not move duplicate files

* Move and rename file with numeric suffix

* Move and overwrite existing files

That way the preference could be stored in a single setting, rather than multiple binary settings relying on code to maintain their mutual exclusivity.

Yes, I think it would be clearer.
Also we need to have same thing for additional files for consistency (I think).
Also we have warning dialogs: perhaps they should clearly state what is going to happen (move where? rename how?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants