beetbox / beetbox/beets

Add global configuration option to enforce case-insensitive directory structure regardless of host filesystem case handling

Open
#5,113 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Proposed solution

Implement global configuration option case_sensitive_filesystem.

`case_sensitive_filesystem: yes` - (Default on operating systems like Linux that are virtually always case-sensitive) Beets may create directories and files in the same parent directory with names that differ only in case.

`case_sensitive_filesystem: no` - (Default on operating systems like Windows that are virtually always case-insensitive) Beets may **NOT** create directories and files in the same parent directory with names that differ only in case.

#### Example

The following directory structure is permitted when case_sensitive_filesystem is set to yes, but forbidden when case_sensitive_filesystem is set to no.

```
Music/
├── An Artist/
│ └── ...
└── An artist/
├── An ALBUM/
│ └── ...
└── an album/
├── Song.flac
└── song.flac
```

### Objective

See [this discussion](https://github.com/beetbox/beets/discussions/5104) for additional background on unexpected behavior that prompted this request.

An important note: This proposal is only concerning the library directory file handling scheme! This configuration option should NOT alter the way Beets handles data within its database or the way Beets disambiguates similar names. This configuration option should ONLY affect the generation of new directories and the filenames of imported files. 'An ALBUM' and 'an album' should still be handled as separate albums, but the directory structure that results from importing them will look different depending on the value of case_sensitive_filesystem.

#### Goals

The goal of this enhancement is to allow users of multiple different filesystems and operating systems to proactively prevent downstream interoperability errors when moving, copying, and syncing across systems that handle case in file and directory names differently.

#### Non-goals

This could be a consideration in an an overhaul of the path code as mentioned in the linked discussion.

#### Anti-goals

It is possible to switch many systems' case-sensitivity settings, but it is incredibly unusual to do so. The default implicit configuration might be able to be determined as a pre-run step, but is this additional overhead worth it for such an edge case? I doubt it.

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked discussion and tracing the library-directory and imported-filename path handling. Define the configuration defaults and scope from the proposal, then add coverage for case-colliding paths while leaving database behavior and name disambiguation unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.