whipper-team / whipper

Python CD-DA ripper preferring accuracy over speed
GNU General Public License v3.0
1.16k stars 91 forks source link

Create whipper.conf with all default options #283

Open xmixahlx opened 6 years ago

xmixahlx commented 6 years ago

To ease configuration, a complete whipper.conf file with all default options could be created at first run (i.e. when ~/.config/whippper/whipper.conf is not detected). Doing so will allow easy access to change options without digging through documentation.

Recommend stating the possible variables in a comment block, i.e. artist, album, track, etc. and a simple "HOWTO".

Also recommend extending the information if running whipper cd rip without any stated or configured offset (i.e. "first time run"): Recommend output of the simple howto block here, or just the entire default configuration file to prompt configuration, i.e. "It looks like you haven't configured whipper yet..."

(The track and disc templates here are useful for most releases, including various artist/compilation type discs.)

Something like:

# HOWTO setup your CD drive for whipper:
# - Select a common undamaged disc
# - Add CD drive details to the whipper config with: whipper drive analyze
# - Add  known drive offset value in whipper.conf (read_offset = #), or detect offset with: whipper offset find
# - Confirm desired configuration file options, including output directory and variables for disc and track naming.

# Track Template Variables only:
# - %t: track number
# - %a: track artist
# - %n: track title
# - %s: track sort name

# Shared Disc and Track Variables:
# - %A: album artist
# - %S: album sort name
# - %d: disc title
# - %y: release year
# - %r: release type, lowercase
# - %R: Release type, normal case
# - %x: audio extension, lowercase
# - %X: audio extension, uppercase

[main]
path_filter_fat = False
path_filter_special = False

[musicbrainz]
server = musicbrainz.org:80

[whipper.cd.rip]
prompt = False
unknown = False
cdr = False
logger = whipper
force_overread = False
output_directory = ~/
working_directory = ~/
track_template = %%A/%%d/%%t - %%a - %%n
disc_template = %%A/%%d/%%A - %%d
RecursiveForest commented 6 years ago

+1-- I'm unsure of whether we should just ship with this sitting in /usr/share/ ... or actually create it in the user's $HOME on first run, but we should ship a valid and complete config file.

xmixahlx commented 6 years ago

I think both is preferable. Shipping in /usr/share and copying to $HOME upon first run. You'll edit in $HOME and won't have to dig further for documentation. You also have a reference default config in /usr/share should things go south.

RecursiveForest commented 6 years ago

Thinking about it a bit more, I think there's some complications with writing on the first run. How do we detect this is the first time the user's run whipper? I think a message on the help screen and documentation/README pointing to the default config in /usr/share/whipper/whipper.conf should be sufficient. Won't require adding any more software to the mix, and I think this is the approach taken by a lot of existing packages.

I also have a personal distaste for writing to a user's config directory without explicit permission. This is distinct from directory creation.

It seems counterintuitive to have a user invoke whipper with certain command line arguments, and then simultaneously write a config file with conflicting options. This would invite feature creep, I think.

so tl;dr: +1 to /usr/share/whipper/whipper.conf

xmixahlx commented 6 years ago

Most applicable settings will be pulled from the user config, i.e. drive, cache, offset, directory, file name, etc. so the home config is necessary. Superseding the /usr/share config or ignoring the /usr/share config seem like the applicable questions.

Or are you against configuring these in the home config entirely?

RecursiveForest commented 6 years ago

I'm only against writing a default config "on first run" (whatever that means) to $HOME. If a config in $HOME exists, it will be read and used by whipper.

The /usr/share config will never be read programmatically by whipper (the place for that would be /etc).

MerlijnWajer commented 6 years ago

What about a flag to initialise the configuration with default values? Or I can just finally finish that manpage... :)

MerlijnWajer commented 6 years ago

See #73

darylf commented 3 years ago

I'd like to add that I had no idea what the track template variables were until I found this thread. The README also mentions "Unknown = True" as an example, but I don't know what tthat prepresents either.

Is there additional documentation regarding configuration that I might have missed? I tried "man whipper" but it doesn't seem to exist.

brulzki commented 3 years ago

You can get the documentation for the rip options by typing 'whipper cd rip --help', and likewise for any other command. The command line options can be used in the config file. It's not super obvious, but it's there.

eharris commented 2 years ago

It has also often annoyed me that whipper destructively modifies the config file for some commands (e.g. whipper drive analyze), removing all comments and whitespace. I normally use comments in config files to document options and was really annoyed to find out all my annotations had been deleted after running analyze on a new drive.

As part of this, I would like the whipper functions that modify the config file either to be made to preserve comments, or to not modify the config file at all (assuming it already exists), and instead instruct the user to add the appropriate configuration lines to it.

hadess commented 7 months ago

You can get the documentation for the rip options by typing 'whipper cd rip --help', and likewise for any other command. The command line options can be used in the config file. It's not super obvious, but it's there.

It's worse than "not super obvious". I've just spent 10 to 15 minutes to unsuccessfully find a way to avoid this error by setting the drive_auto_close to False in the config file, and couldn't figure out in which section to put it (I tried [whipper.cd], [whipper.cd.rip], [whipper.offset], [main] and the drive-specific section without success).

Olivetti commented 21 hours ago

@hadess

You missed one section:

[whipper]
eject = never
drive_auto_close = false