Skip to content

Commit

Permalink
feat: config option to play on add
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeStanger committed Apr 1, 2020
1 parent 7bc9427 commit 629e992
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions rofi_mpd/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def load_default():
enable_disc_names=True,
tracks_keep_open=True,
discs_keep_open=True,
play_on_add=False,
hosts=[
dict(
host='localhost',
Expand Down
4 changes: 4 additions & 0 deletions rofi_mpd/rofi_mpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,7 @@ def run():

else:
client.add(track['file'])

if 'play_on_add' in config and config['play_on_add']:
if client.status()['state'] != 'play':
client.play()

0 comments on commit 629e992

Please sign in to comment.