Skip to content

Commit 176a3ff

Browse files
committed
Replace cached_property with cached_data_property
1 parent 78dfd6c commit 176a3ff

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

plexapi/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ def sessions(self):
10381038
def transcodeSessions(self):
10391039
return [self.transcodeSession] if self.transcodeSession else []
10401040

1041-
@cached_property
1041+
@cached_data_property
10421042
def user(self):
10431043
""" Returns the :class:`~plexapi.myplex.MyPlexAccount` object (for admin)
10441044
or :class:`~plexapi.myplex.MyPlexUser` object (for users) for this session.

plexapi/server.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
import os
3-
from functools import cached_property
43
from urllib.parse import urlencode
54

65
import requests
@@ -167,7 +166,7 @@ def _headers(self, **kwargs):
167166
def _uriRoot(self):
168167
return f'server://{self.machineIdentifier}/com.plexapp.plugins.library'
169168

170-
@cached_property
169+
@cached_data_property
171170
def library(self):
172171
""" Library to browse or search your media. """
173172
try:
@@ -178,7 +177,7 @@ def library(self):
178177
data = self.query('/library/sections/')
179178
return Library(self, data)
180179

181-
@cached_property
180+
@cached_data_property
182181
def settings(self):
183182
""" Returns a list of all server settings. """
184183
data = self.query(Settings.key)

plexapi/video.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
import os
3-
from functools import cached_property
43
from pathlib import Path
54
from urllib.parse import quote_plus
65

@@ -1112,7 +1111,7 @@ def writers(self):
11121111
def ultraBlurColors(self):
11131112
return self.findItem(self._data, media.UltraBlurColors)
11141113

1115-
@cached_property
1114+
@cached_data_property
11161115
def parentKey(self):
11171116
""" Returns the parentKey. Refer to the Episode attributes. """
11181117
if self._parentKey:
@@ -1121,7 +1120,7 @@ def parentKey(self):
11211120
return f'/library/metadata/{self.parentRatingKey}'
11221121
return None
11231122

1124-
@cached_property
1123+
@cached_data_property
11251124
def parentRatingKey(self):
11261125
""" Returns the parentRatingKey. Refer to the Episode attributes. """
11271126
if self._parentRatingKey is not None:
@@ -1134,7 +1133,7 @@ def parentRatingKey(self):
11341133
return self._season.ratingKey
11351134
return None
11361135

1137-
@cached_property
1136+
@cached_data_property
11381137
def parentThumb(self):
11391138
""" Returns the parentThumb. Refer to the Episode attributes. """
11401139
if self._parentThumb:
@@ -1143,7 +1142,7 @@ def parentThumb(self):
11431142
return self._season.thumb
11441143
return None
11451144

1146-
@cached_property
1145+
@cached_data_property
11471146
def _season(self):
11481147
""" Returns the :class:`~plexapi.video.Season` object by querying for the show's children. """
11491148
if self.grandparentKey and self.parentIndex is not None:
@@ -1183,7 +1182,7 @@ def episodeNumber(self):
11831182
""" Returns the episode number. """
11841183
return self.index
11851184

1186-
@cached_property
1185+
@cached_data_property
11871186
def seasonNumber(self):
11881187
""" Returns the episode's season number. """
11891188
if isinstance(self.parentIndex, int):

0 commit comments

Comments
 (0)