Fix KeyError when there isn't mpv section in config file (#7)

This commit is contained in:
Nguyễn Gia Phong 2018-01-30 09:39:15 +07:00
parent 0500d98b0a
commit 082685cee3
2 changed files with 3 additions and 3 deletions

4
comp
View File

@ -16,7 +16,7 @@
#
# Copyright (C) 2017 Nguyễn Gia Phong <vn.mcsinyx@gmail.com>
__version__ = '0.4.3'
__version__ = '0.4.4'
import curses
import json
@ -343,7 +343,7 @@ json_file = args.playlist if args.extractor == 'json' else ''
config = ConfigParser()
config.read(args.config)
mode = config.get('comp', 'play-mode', fallback='play-current')
mpv_args = dict(config['mpv'])
mpv_args = dict(config['mpv']) if 'mpv' in config else {}
if args.vo is not None: mpv_args['vo'] = args.vo
ytdlf = args.format or config.get('youtube-dl', 'format', fallback='best')

View File

@ -7,7 +7,7 @@ with open('README.rst') as f:
setup(
name='comp',
version='0.4.3',
version='0.4.4',
description=('Curses Omni Media Player'),
long_description=long_description,
url='https://github.com/McSinyx/comp',