convert: Keep-both option
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
### Use case
As described in issue #3407, my use-case is to have beets manage albums in more than one format. I like to keep FLAC files for when space is not an issue, ogg to use on my phone, and mp3 for my wife's old player that can't read ogg. So, ideally, I would like the option to do the following:
* If importing a lossless format
* import it to `$albumartist_sort/${albumtype}s/$original_year - $album [FLAC]/$track $title`, AND
* convert to ogg files in `$original_year - $album [OGG]/` directory located in the same parent as the FLAC directory above, AND
* convert likewise to MP3, AND
* import all three formats into my beets database, so I can use the format info in queries.
### Solution
My immediate thought is that instead of the toggle `--keep-new` to choose between keeping the original in your library and relegating the converted version to an untracked external directory tree, vs replacing the original with the converted version, the option should be `--keep` and accept the values 'original', 'new', and 'both', with 'both' importing the transcoded version into the library alongside the original.
### Alternatives
As a workaround, converting an album to an external directory *without* `--keep-new`, and then importing that directory, does seem to achieve my goal (and the import step takes care of the problem of 'convert' not using the right `${format}` string for the output directory). It's clunky though, and as far as I can tell the only way to automate this process is to write my own helper script.
Contributor guide
Research direction
Start with the convert command and its existing --keep-new option, then review issue #3407 and the workaround described here to clarify the desired behavior. Done means --keep supports original, new, and both, with both retaining and importing the original and transcoded formats as separate library entries.
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
- Mostly clear
- Newbie friendliness
- 25/100