Skip to content

Commit

Permalink
Try select the currently active device
Browse files Browse the repository at this point in the history
  • Loading branch information
ceuk committed Jun 18, 2020
1 parent a3525d8 commit 60bd8f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="spotui",
version="0.1.11",
version="0.1.12",
author="ceuk",
description="Spotify TUI",
long_description=long_description,
Expand Down
7 changes: 5 additions & 2 deletions spotui/src/MainForm.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ def __init__(self, stdscr):

# Set initial device ID
devices = self.api.get_devices()
self.device_id = devices[0]["id"] if devices and len(
devices) > 0 else None
if "device" in self.status and self.status["device"]["is_active"]:
self.device_id = self.status["device"]["id"]
else:
self.device_id = devices[0]["id"] if devices and len(
devices) > 0 else None

# Initial render
self.render()
Expand Down

0 comments on commit 60bd8f3

Please sign in to comment.