beetbox / beetbox/beets

Null-termination option for "list" command

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

Description

By default some albums/songs contain apostrophes/spaces/ampersandes and maybe other nasty characters:

```

$ beet list -p "Licensed to Ill"
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/01 Rhymin & Stealin.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/02 The New Style.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/03 She's Crafty.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/04 Posse in Effect.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/05 Slow Ride.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/06 Girls.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/07 Fight for Your Right.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/08 No Sleep Till Brooklyn.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/09 Paul Revere.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/10 Hold It Now, Hit It.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/11 Brass Monkey.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/12 Slow and Low.mp3
/home/dfc/MyTunes/Beastie Boys/Licensed to Ill/13 Time to Get Ill.mp3

```

This makes the `list -p` option a lot less useful:

```
$ beet list -p "Licensed to Ill"|xargs --replace du -sk "{}"
7764 /home/dfc/MyTunes/Beastie Boys/Licensed to Ill/01 Rhymin & Stealin.mp3
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option
8620 /home/dfc/MyTunes/Beastie Boys/Licensed to Ill/02 The New Style.mp3

```

There are two solutions:
1. "OMG dfc you are driving me crazy with these paper cuts. Just use the config file and tell beets to replace all of these characters in the path creation!"
2. Add an `-0` option for `list -p` that would null terminate strings so I could pipe them to other unix commands.

I can totally understand the first solution. If beets was not so UNIXy I could be convinced that this was something for power users to twiddle in the config.yaml. In fact when I first set up beets I almost configured beets to always make commandline friendly path names. I hesitated doing this because I do not like to change default assumptions like this in case a change to beets is introduced that relies on the default path sanitizing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.