try:
success = await self._run_async(self._conn.ping)
if not success:
- msg = (
- f"Failed to connect to {self.config.get_value(CONF_BASE_URL)}, "
- "check your settings."
- )
- raise LoginFailed(msg)
+ raise CredentialError
except (AuthError, CredentialError) as e:
msg = (
- f"Failed to connect to {self.config.get_value(CONF_BASE_URL)}, check your settings."
+ "Failed to connect to "
+ f"{self.config.get_value(CONF_BASE_URL)}"
+ ", check your settings."
)
raise LoginFailed(msg) from e
self._enable_podcasts = self.config.get_value(CONF_ENABLE_PODCASTS)
)
else:
self.logger.info(
- f"Unable to find an artist ID for album '{sonic_album.name}' with "
- f"ID '{sonic_album.id}'."
+ "Unable to find an artist ID for album '%s' with ID '%s'.",
+ sonic_album.name,
+ sonic_album.id,
)
album.artists.append(
Artist(
# We are setting disc number to 0 because the standard for what is part of
# a Open Subsonic Song is not yet set and the implementations I have checked
# do not contain this field. We should revisit this when the spec is finished
- disc_number=0,
+ disc_number=sonic_song.disc_number or 0,
favorite=bool(sonic_song.starred),
provider_mappings={
ProviderMapping(
# because it will not have an entry in the artists table so the best we can do it
# add a 'fake' id with the proper artist name and have get_artist() check for this
# id and handle it locally.
+ fake_id = f"{NAVI_VARIOUS_PREFIX}{sonic_song.artist}"
artist = Artist(
- item_id=f"{NAVI_VARIOUS_PREFIX}{sonic_song.artist}",
+ item_id=fake_id,
provider=self.domain,
name=sonic_song.artist,
provider_mappings={
ProviderMapping(
- item_id=UNKNOWN_ARTIST_ID,
+ item_id=fake_id,
provider_domain=self.domain,
provider_instance=self.instance_id,
)
)
else:
self.logger.info(
- f"Unable to find artist ID for track '{sonic_song.title}' with "
- f"ID '{sonic_song.id}'."
+ "Unable to find artist ID for track '%s' with ID '%s'.",
+ sonic_song.title,
+ sonic_song.id,
)
artist = Artist(
item_id=UNKNOWN_ARTIST_ID,