Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from ping13/bugfix
Browse files Browse the repository at this point in the history
Bugfixes #19 and #20
  • Loading branch information
ping13 authored Sep 24, 2022
2 parents 768b524 + adc5029 commit 8610e3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions heospy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# determine a default path for the config file
DEFAULT_CONFIG_PATH = "."
for location in os.environ.get("HEOSPY_CONF"), os.environ.get("HEOSPY_CONF"):
for location in os.path.expanduser("~/.heospy"), os.environ.get("HEOSPY_CONF"):
if location is None:
continue
try:
Expand Down Expand Up @@ -300,12 +300,15 @@ def cmd(self, cmd, args):
else:
# if this is a command where a gid or a pid is needed, check if we
# could use the default pid from the config file
if ("groups/" in cmd or "group/" in cmd) and not gid_explicitly_given:
if ("group/" in cmd) and not gid_explicitly_given:
logging.info("I assume default group with id {0}".format(self.pid))
s = '{0}?gid={1}'.format(cmd, self.pid)
elif ("player/" in cmd or "players" in cmd) and not pid_explicitly_given:
logging.info("I assume default player with id {0}".format(self.pid))
s = '{0}?pid={1}'.format(cmd, self.pid)
elif ("browse/play" in cmd) and not pid_explicitly_given:
logging.info("I assume default player with id {0}".format(self.pid))
s = '{0}?pid={1}'.format(cmd, self.pid)
else:
s = '{0}?dummy=1'.format(cmd) # use dummy so that
# args_concatenated is correctly attached
Expand Down

0 comments on commit 8610e3f

Please sign in to comment.