Replace pylint protected-access with Ruff SLF001 (#115735)

This commit is contained in:
Sid 2024-05-06 20:33:26 +02:00 committed by GitHub
parent 460c05dc43
commit b456d97e65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
90 changed files with 168 additions and 223 deletions

View file

@ -324,7 +324,7 @@ def library_section_payload(section):
children_media_class = ITEM_TYPE_MEDIA_CLASS[section.TYPE]
except KeyError as err:
raise UnknownMediaType(f"Unknown type received: {section.TYPE}") from err
server_id = section._server.machineIdentifier # pylint: disable=protected-access
server_id = section._server.machineIdentifier # noqa: SLF001
return BrowseMedia(
title=section.title,
media_class=MediaClass.DIRECTORY,
@ -357,7 +357,7 @@ def hub_payload(hub):
media_content_id = f"{hub.librarySectionID}/{hub.hubIdentifier}"
else:
media_content_id = f"server/{hub.hubIdentifier}"
server_id = hub._server.machineIdentifier # pylint: disable=protected-access
server_id = hub._server.machineIdentifier # noqa: SLF001
payload = {
"title": hub.title,
"media_class": MediaClass.DIRECTORY,
@ -371,7 +371,7 @@ def hub_payload(hub):
def station_payload(station):
"""Create response payload for a music station."""
server_id = station._server.machineIdentifier # pylint: disable=protected-access
server_id = station._server.machineIdentifier # noqa: SLF001
return BrowseMedia(
title=station.title,
media_class=ITEM_TYPE_MEDIA_CLASS[station.type],