Rename is_online to is_discover for clarity
MODIFY
plextraktsync/commands/inspect.py
plextraktsync/commands/inspect.py
@@ -41,7 +41,7 @@ def inspect_media(id):
if not pm.is_legacy_agent:
print(f"Media.Guids: {media.guids}")
- if not pm.is_online and media.type in ["episode", "movie"]:
+ if not pm.is_discover and media.type in ["episode", "movie"]:
audio = pm.audio_streams[0]
print(f"Audio: '{audio.audioChannelLayout}', '{audio.displayTitle}'")

MODIFY
plextraktsync/media.py
plextraktsync/media.py
@@ -209,7 +209,7 @@ def plex_rate(self):
self.plex_api.rate(self.plex.item, self.trakt_rating)
def plex_history(self, **kwargs):
- if self.plex.is_online:
+ if self.plex.is_discover:
return []
return self.plex_api.history(self.plex.item, **kwargs)

MODIFY
plextraktsync/plex/PlexApi.py
plextraktsync/plex/PlexApi.py
@@ -92,7 +92,7 @@ def reload_item(self, pm: PlexLibraryItem):
return self.fetch_item(key)
def media_url(self, m: PlexLibraryItem):
- base_url = self.plex_discover_base_url if m.is_online else self.plex_base_url
+ base_url = self.plex_discover_base_url if m.is_discover else self.plex_base_url
return f"{base_url}/details?key={m.item.key}"
def download(self, m: Union[SubtitleStream], **kwargs):

MODIFY
plextraktsync/plex/PlexLibraryItem.py
plextraktsync/plex/PlexLibraryItem.py
@@ -31,7 +31,7 @@ def is_legacy_agent(self):
return not self.item.guid.startswith("plex://")
@cached_property
- def is_online(self):
+ def is_discover(self):
# Use __dict__ access to prevent reloads:
# https://github.com/pkkid/python-plexapi/pull/1093
return self.item.__dict__["librarySectionID"] is None
@@ -87,7 +87,7 @@ def library(self):
if not self.plex:
raise RuntimeError("Need plex property to retrieve library")
- if self.is_online:
+ if self.is_discover:
return None
if self.item.librarySectionID not in self.plex.library_sections:
@@ -110,7 +110,7 @@ def title(self):
@retry(retries=1)
def rating(self, show_id: int = None):
- if not self.is_online and self.plex is not None:
+ if not self.is_discover and self.plex is not None:
return self.plex.ratings.get(self, show_id)
else:
user_rating = self.item.userRating
@@ -162,7 +162,7 @@ def audio_channels(self):
"""
Set to 1.0, 2.0, 2.1, 3.0, 3.1, 4.1, 5.1, 6.1, 7.1, 9.1, or 10.1
"""
- if self.is_online:
+ if self.is_discover:
return None
try:
@@ -179,7 +179,7 @@ def audio_channels(self):
@property
def audio_codec(self):
- if self.is_online:
+ if self.is_discover:
return None
try:
@@ -196,7 +196,7 @@ def resolution(self):
"""
Set to uhd_4k, hd_1080p, hd_1080i, hd_720p, sd_480p, sd_480i, sd_576p, or sd_576i.
"""
- if self.is_online:
+ if self.is_discover:
return None
try:
stream = self.video_streams[0]
@@ -242,7 +242,7 @@ def hdr(self):
"""
Set to dolby_vision, hdr10, hdr10_plus, or hlg
"""
- if self.is_online:
+ if self.is_discover:
return None
try:

Rename is_online to is_discover for clarity