Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play: make the many files warning configurable #1577

Merged
merged 2 commits into from
Sep 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion beetsplug/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self):
'use_folders': False,
'relative_to': None,
'raw': False,
'warning_treshold': 100,
})

def commands(self):
Expand All @@ -64,6 +65,7 @@ def play_music(self, lib, opts, args):
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)

Expand Down Expand Up @@ -105,7 +107,7 @@ def play_music(self, lib, opts, args):
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),
Expand Down
5 changes: 4 additions & 1 deletion docs/plugins/play.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ configuration file. The available options are:
- **command**: The command used to open the playlist.
Default: ``open`` on OS X, ``xdg-open`` on other Unixes and ``start`` on
Windows. Insert ``{}`` to make use of the ``--args``-feature.
- **relative_to**: Emit paths relative to base directory.
- **relative_to**: If set, emit paths relative to this directory.
Default: None.
- **use_folders**: When using the ``-a`` option, the m3u will contain the
paths to each track on the matched albums. Enable this option to
Expand All @@ -47,6 +47,9 @@ configuration file. The available options are:
- **raw**: Instead of creating a temporary m3u playlist and then opening it,
simply call the command with the paths returned by the query as arguments.
Default: ``no``.
- **warning_treshold**: Set the minimum number of files to play which will
trigger a warning to be emitted. If set to ``no``, warning are never issued.
Default: 100.

Optional Arguments
------------------
Expand Down