Allow setting default options for %unique in the configuration file.

This commit is contained in:
David Logie 2018-09-04 18:14:18 +01:00
parent ce03e5a2e4
commit 86d75cfad7
4 changed files with 28 additions and 3 deletions

View file

@ -48,6 +48,12 @@ asciify_paths: false
art_filename: cover
max_filename_length: 0
aunique:
keys: albumartist album
disambiguators: albumtype year label catalognum albumdisambig
bracket: '[]'
plugins: []
pluginpath: []
threaded: yes

View file

@ -1510,10 +1510,10 @@ class DefaultTemplateFunctions(object):
if memoval is not None:
return memoval
keys = keys or 'albumartist album'
disam = disam or 'albumtype year label catalognum albumdisambig'
keys = keys or beets.config['aunique']['keys'].as_str()
disam = disam or beets.config['aunique']['disambiguators'].as_str()
if bracket is None:
bracket = '[]'
bracket = beets.config['aunique']['bracket'].as_str()
keys = keys.split()
disam = disam.split()

View file

@ -37,6 +37,8 @@ New features:
relevant releases according to the :ref:`preferred` configuration options.
Thanks to :user:`archer4499`.
:bug:`3017`
* A new ``aunique`` configuration option allows setting default options
for the :ref:`aunique` template function.
Fixes:

View file

@ -286,6 +286,23 @@ numbered from one, not zero, so other track numbers may appear to be bumped up
by one. When it is on, the pregap track for each disc can be numbered zero.
.. _config-aunique:
anique
~~~~~~
These options are used to generate a string that is guaranteed to be unique
among all albums in the library who share the same set of keys.
The defaults look like this::
aunique:
keys: albumartist album
disambiguators: albumtype year label catalognum albumdisambig
bracket: '[]'
See :ref:`aunique` for more details.
.. _terminal_encoding:
terminal_encoding