Skip to content

Commit

Permalink
[Feature] Display upmpdcli configuration parameters #37
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Nov 4, 2023
1 parent 9d8dc99 commit 8d5a328
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ In order to avoid issues with password, which might contain special characters,

## Releases

### Release 0.3.1 (2023-11-04)

- Display upmpdcli configuration parameters (see issue [#37](https://github.com/GioF71/mpd-subsonic-scrobbler/issues/37))

### Release 0.3.0 (2023-11-04)

- Allow upmpdcli server restrictions (see issue [#35](https://github.com/GioF71/mpd-subsonic-scrobbler/issues/35))
Expand Down
2 changes: 2 additions & 0 deletions mpd_subsonic_scrobbler/scrobbler.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def show_subsonic_servers(config : ScrobblerConfig):
print(f"server[{cnt}].friendly_name=[{current.get_friendly_name()}]")
print(f"server[{cnt}].base_url=[{current.getBaseUrl()}]")
print(f"server[{cnt}].port=[{current.getPort()}]")
print(f"server[{cnt}].upmpdcli_base_url=[{current.getUpmpdcliBaseUrl()}]")
print(f"server[{cnt}].upmpdcli_port=[{current.getUpmpdcliPort()}]")
if not config.get_redact_credentials(): print(f"server[{cnt}].user=[{current.getUserName()}]")
if not config.get_redact_credentials(): print(f"server[{cnt}].password=[{current.getPassword()}]")

Expand Down
2 changes: 1 addition & 1 deletion mpd_subsonic_scrobbler/subsonic_server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ def getPort(self) -> str: return self.__dict[ConfigKey.SUBSONIC_PORT.get_key()]
def getUserName(self) -> str: return self.__dict[ConfigKey.SUBSONIC_USER.get_key()]
def getPassword(self) -> str: return self.__dict[ConfigKey.SUBSONIC_PASSWORD.get_key()]
def getUpmpdcliBaseUrl(self) -> str: return self.__ifin_else(ConfigKey.SUBSONIC_UPMPDCLI_BASE_URL)
def getUpmpdcliBasePort(self) -> str: return self.__ifin_else(ConfigKey.SUBSONIC_UPMPDCLI_PORT)
def getUpmpdcliPort(self) -> str: return self.__ifin_else(ConfigKey.SUBSONIC_UPMPDCLI_PORT)
def getApiVersion(self) -> str: return libsonic.API_VERSION
def getAppName(self) -> str: return "mpd-subsonic-scrobbler"
4 changes: 2 additions & 2 deletions mpd_subsonic_scrobbler/subsonic_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def __get_subsonic_track_id_for_config(
return id
else:
# try upmpdcli trackid
notset : bool = not subsonic_server_config.getUpmpdcliBaseUrl() and not subsonic_server_config.getUpmpdcliBasePort()
match : bool = notset or (cmp_url == subsonic_server_config.getUpmpdcliBaseUrl() and parsed_url.port == int(subsonic_server_config.getUpmpdcliBasePort()))
notset : bool = not subsonic_server_config.getUpmpdcliBaseUrl() and not subsonic_server_config.getUpmpdcliPort()
match : bool = notset or (cmp_url == subsonic_server_config.getUpmpdcliBaseUrl() and parsed_url.port == int(subsonic_server_config.getUpmpdcliPort()))
if match:
path : str = parsed_url.path
if path:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mpd-subsonic-scrobbler"
version = "0.3.0"
version = "0.3.1"
description = "A Subsonic Scrobbler for Music Player Daemon"
authors = ["GioF_71 <giovanni.fulco@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 8d5a328

Please sign in to comment.