Use cached_property instead of stacked property + cache (#67515)

This commit is contained in:
Marc Mueller 2022-03-03 23:59:48 +01:00 committed by GitHub
parent 9356bf1a8e
commit a55d20f164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -680,8 +680,7 @@ class DmsDeviceSource:
"""Make an identifier for BrowseMediaSource.""" """Make an identifier for BrowseMediaSource."""
return f"{self.source_id}/{action}{object_id}" return f"{self.source_id}/{action}{object_id}"
@property # type: ignore @functools.cached_property
@functools.cache
def _sort_criteria(self) -> list[str]: def _sort_criteria(self) -> list[str]:
"""Return criteria to be used for sorting results. """Return criteria to be used for sorting results.