mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 17:43:52 +01:00
play: make the many files warning configurable
The warning_treshold key in the play configuration defines the minimum number of file before a warning is issued (default 100). A zero value means no warning is ever issued. This is the first commit for this feature, and this should fully implement it.
This commit is contained in:
parent
bc137b174f
commit
ff4fda1bb5
1 changed files with 3 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ class PlayPlugin(BeetsPlugin):
|
|||
'use_folders': False,
|
||||
'relative_to': None,
|
||||
'raw': False,
|
||||
'warning_treshold': 100,
|
||||
})
|
||||
|
||||
def commands(self):
|
||||
|
|
@ -64,6 +65,7 @@ class PlayPlugin(BeetsPlugin):
|
|||
use_folders = config['play']['use_folders'].get(bool)
|
||||
relative_to = config['play']['relative_to'].get()
|
||||
raw = config['play']['raw'].get(bool)
|
||||
warning_treshold = config['play']['warning_treshold'].get(int)
|
||||
if relative_to:
|
||||
relative_to = util.normpath(relative_to)
|
||||
|
||||
|
|
@ -105,7 +107,7 @@ class PlayPlugin(BeetsPlugin):
|
|||
return
|
||||
|
||||
# Warn user before playing any huge playlists.
|
||||
if len(selection) > 100:
|
||||
if warning_treshold and len(selection) > warning_treshold:
|
||||
ui.print_(ui.colorize(
|
||||
'text_warning',
|
||||
'You are about to queue {0} {1}.'.format(len(selection),
|
||||
|
|
|
|||
Loading…
Reference in a new issue