Some smaller fixes.
- Limit config core.restore_state to a known set of values. - Initialize new_state to None instead of ''
This commit is contained in:
parent
6e99a95aae
commit
abe3d67bc1
@ -21,7 +21,8 @@ _core_schema['config_dir'] = Path()
|
||||
_core_schema['data_dir'] = Path()
|
||||
# MPD supports at most 10k tracks, some clients segfault when this is exceeded.
|
||||
_core_schema['max_tracklist_length'] = Integer(minimum=1, maximum=10000)
|
||||
_core_schema['restore_state'] = String(optional=True)
|
||||
_core_schema['restore_state'] = String(
|
||||
optional=True, choices=['off', 'volume', 'load', 'last', 'play'])
|
||||
|
||||
_logging_schema = ConfigSchema('logging')
|
||||
_logging_schema['color'] = Boolean()
|
||||
|
||||
@ -554,7 +554,7 @@ class PlaybackController(object):
|
||||
if state:
|
||||
if not isinstance(state, models.PlaybackState):
|
||||
raise TypeError('Expect an argument of type "PlaybackState"')
|
||||
new_state = ''
|
||||
new_state = None
|
||||
if 'play-always' in coverage:
|
||||
new_state = PlaybackState.PLAYING
|
||||
if 'play-last' in coverage:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user