beetbox / beetbox/beets

[Feature Request] Add an interactive manual track-reordering/mapping option during import

Open
#6,751 1 comment 2 reactions 0 assignees View on GitHub
needinfo
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Problem
When importing music releases (especially vinyl rips or compilation EPs), local files sometimes lack internal track number tags (`tracknumber`). In these cases, Beets defaults to an internal index of `(#0)` for all tracks and attempts to sort them alphabetically or by filesystem read order.

When a metadata match is found (e.g., via Discogs ID), Beets frequently misaligns the local files with the remote release tracks because the sorting order is broken.

Currently, the user is stuck with options like `as Tracks` (which drops the album context and requires individual searches if file names are complex) or `Use as-is` (which bypasses the clean remote metadata). There is no native way to say: *"This specific local file is actually Track #3 on this release."*

### Suggested Feature
I would like to propose an interactive **Track Reordering / Manual Mapping** option directly inside the import prompt menu (similar to how `Group albums` or `as Tracks` works).

When a user selects this option (e.g., pressing `R` for `Reorder`), Beets could display a prompt allowing the user to map local files to target track positions.

**Example UI flow:**
```text
Match (6.5%): Dialog - DOT 2
≠ (#0) 02 - Stranger.aiff -> (#1) If You Know
≠ (#0) 03 - Warm.aiff -> (#2) Stranger
≠ (#0) 04 - High Grade.aiff -> (#3) Warm
≠ (#0) 01 - If You Know.aiff -> (#4) High Grade

➜ [A]pply, More candidates, Skip, Use as-is, as Tracks, [R]eorder tracks, aBort? R

Select local file index to map for Track #1 (If You Know):
[1] 02 - Stranger.aiff
[2] 03 - Warm.aiff
[3] 04 - High Grade.aiff
[4] 01 - If You Know.aiff
Enter selection: 4
```

### Alternative Automated Solution: Fuzzy Title-to-Filename Matching
Before forcing the user into a manual prompt, Beets could implement a fallback matching heuristic when all local track numbers are identical or missing (`#0`).

Beets could use a basic string-distance algorithm (like Levenshtein distance) to compare the remote track names (e.g., `If You Know`) against the local file names (e.g., `01 - If You Know (feat. Benji & Josei).aiff`). If a high-confidence match is found across all tracks, Beets could automatically reorder the mapping without user intervention.

Contributor guide

Open the contributing guide

Research direction

Start at the import prompt menu and trace the existing Group albums and as Tracks options to understand where a Reorder action would fit. Define how local files map to target track positions and how the import proceeds afterward; done means the mapping can be completed interactively without losing the matched release metadata.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.