Skip to content

Commit 6b9d766

Browse files
committed
Remove compatibility with misspelled config option
This has been hanging around long enough; it's about time to drop the old name.
1 parent c9ec5e4 commit 6b9d766

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

beetsplug/play.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ def __init__(self):
6464
'use_folders': False,
6565
'relative_to': None,
6666
'raw': False,
67-
# Backwards compatibility. See #1803 and line 155
68-
'warning_threshold': -2,
69-
'warning_treshold': 100,
67+
'warning_threshold': 100,
7068
})
7169

7270
self.register_listener('before_choose_candidate',
@@ -162,16 +160,6 @@ def _exceeds_threshold(self, selection, command_str, open_args,
162160
True, cancel playback. If False, execute play command.
163161
"""
164162
warning_threshold = config['play']['warning_threshold'].get(int)
165-
# We use -2 as a default value for warning_threshold to detect if it is
166-
# set or not. We can't use a falsey value because it would have an
167-
# actual meaning in the configuration of this plugin, and we do not use
168-
# -1 because some people might use it as a value to obtain no warning,
169-
# which wouldn't be that bad of a practice.
170-
if warning_threshold == -2:
171-
# if warning_threshold has not been set by user, look for
172-
# warning_treshold, to preserve backwards compatibility. See #1803.
173-
# warning_treshold has the correct default value of 100.
174-
warning_threshold = config['play']['warning_treshold'].get(int)
175163

176164
# Warn user before playing any huge playlists.
177165
if warning_threshold and len(selection) > warning_threshold:

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Fixes:
4949
header when requesting lyrics. :bug:`2357`
5050
* :doc:`/plugins/embyupdate`: The plugin now checks whether an API key or a
5151
password is provided in the configuration.
52+
* :doc:`/plugins/play`: The misspelled configuration option
53+
``warning_treshold`` is no longer supported.
5254

5355
For plugin developers: new importer prompt choices (see :ref:`append_prompt_choices`), you can now provide new candidates for the user to consider.
5456

0 commit comments

Comments
 (0)