beetbox / beetbox/beets

Automatic singleton detection

Open
#1,167 12 comments 1 reaction 0 assignees View on GitHub
feature
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

It would be great if beets is able to decide if a particular file should be imported as part of an album or a singleton. These need comes from my personal music library:
I've got a folder for each artist. Below the artist folder follow folders for each album of the artist as well as single files which do not belong to an album.
Example `find`-like output

```
> find /music
/music/artist1
/music/artist1/album1
/music/artist1/album1/01 - album_track.mp3
/music/artist1/album1/02 - album_track.mp3
/music/artist1/singleton_track_01.mp3
```

Using `beet import /music` will create two albums: One for album1 and one more or less random for the singleton. That's definitely not what I want :wink:. The singletons can be identifies using the file name (they don't start with two or more digits followed by `-`).
To solve this, I see the following solutions:
1. Move all singletons away before starting the import; import everything else using `beet import`; move the files back; import every singleton file explicitly using `beet import -s`.
2. Implement a filter which filters out the file which should not be imported. The filter could use different configurations for the import of singletons and albums. So I could just write `beet import /music; beet import -s /music`.
3. Implement something that is able to decide how a file should be imported. Something like `beet import --auto-singleton /music`
The first solution works right now but is a bad way 'cause it's very slow and not the way it should be done. The second one is the most flexible one whereas the third does not require two beet runs.

I'm willing to do all the implementation but we should decide how to do it first :wink:

Suggestions are welcome!

Contributor guide

Open the contributing guide

Research direction

Start with the `beet import` command and its existing `-s` singleton mode. The issue names no files or tests, and the three proposed approaches leave the behavior and interface undecided, so first review the import flow and resolve the design with maintainers. Done means singleton files are detected according to an agreed rule without creating an unintended album.

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
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.