Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Skip episodes from Specials #1674

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plextraktsync/media/MediaFactory.py
Original file line number Diff line number Diff line change
@@ -62,6 +62,10 @@ def resolve_guid(self, guid: PlexGuid, show: Media = None):

try:
if show:
if guid.is_special:
self.logger.warning(f"Skipping Special: {guid.title_link}", extra={"markup": True})
return None

tm = self.trakt.find_episode_guid(guid, show.seasons)
else:
tm = self.trakt.find_by_guid(guid)
7 changes: 7 additions & 0 deletions plextraktsync/plex/PlexGuid.py
Original file line number Diff line number Diff line change
@@ -77,6 +77,13 @@ def unsupported(self):
"""Known providers that can't be synced"""
return self.provider in ["youtube", "xmltv"]

@property
def is_special(self):
if self.media_type != "episodes":
raise ValueError("is_special is not valid for non-episodes")

return self.pm.season_number == 0

@cached_property
def show_id(self):
if not self.is_episode:
Loading