Skip to content

Stop Remux and Lowercase Renames From Overwriting an Existing File #1073

Closed

Description

@ptr727

Behavior

  • Convert.ReMuxToMkv() moves its output to the input name with a .mkv extension, with overwrite on. Remuxing name.avi replaces an existing name.mkv without a warning.
  • ProcessFile.MakeExtensionLowercase() renames name.MKV to name.mkv with overwrite on. On a case-sensitive filesystem that replaces an existing name.mkv.

Reproduction shape

  1. Create a folder holding both name.avi and name.mkv, with ReMux: true and .avi in ReMuxExtensions.
  2. Run process.
  3. name.mkv is replaced by the remuxed name.avi.

Expected

A rename that would replace a different existing file fails that file, or picks a non-colliding name, rather than overwriting.

Found while drawing the process command diagrams, ARCHITECTURE.md "Process Command Logic", suspect branch S6.

Activity

  1. added
    bug
    pre-existing
    on Oct 29, 2026
  2. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Decision from the maintainer (2026-10-30): when a rename or move would land on a file that already exists, fail the file.

    Claim (backlog burndown round 1, fixed together with #1109): branch feature/1073-1109-rename-collisions, files PlexCleaner/ProcessFile.cs, PlexCleaner/Convert.cs, new PlexCleanerTests/RenameCollisionTests.cs. ARCHITECTURE.md and HISTORY.md are deferred to one final docs pull request by the maintainer's choice, so this group does not touch them.

  3. ptr727 commented on Oct 31, 2026

    @ptr727
    OwnerAuthor

    Updated decision from the maintainer (2026-10-30), replacing the one above: fail the file without deleting it. A collision marks the file failed but skipped, the same as the exception and read-only paths, so DeleteFailedFile() never runs. The collision is checked before the remux tool runs. Nothing is overwritten or deleted.

  4. added a commit that references this issue on Oct 31, 2026
    2bb797b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions