Use TraktMedia type
MODIFY
plextraktsync/trakt/TraktApi.py
plextraktsync/trakt/TraktApi.py
from plextraktsync.trakt.ScrobblerProxy import ScrobblerProxy
from plextraktsync.trakt.TraktLookup import TraktLookup
from plextraktsync.trakt.TraktRatingCollection import TraktRatingCollection
+from plextraktsync.trakt.types import TraktMedia
if TYPE_CHECKING:
from typing import List, Optional, Union
from trakt.movies import Movie
- from trakt.tv import TVEpisode, TVSeason, TVShow
+ from trakt.tv import TVEpisode, TVShow
from plextraktsync.plex.PlexGuid import PlexGuid
from plextraktsync.plex_api import PlexLibraryItem
@@ -112,7 +113,7 @@ def show_collection(self):
@rate_limit()
@time_limit()
@retry()
- def remove_from_library(self, media: Union[Movie, TVShow, TVSeason, TVEpisode]):
+ def remove_from_library(self, media: TraktMedia):
media.remove_from_library()
@cached_property

MODIFY
plextraktsync/trakt/TraktItem.py
plextraktsync/trakt/TraktItem.py
from typing import TYPE_CHECKING
-from trakt.movies import Movie
-from trakt.tv import TVEpisode, TVSeason, TVShow
-
from plextraktsync.decorators.cached_property import cached_property
if TYPE_CHECKING:
- from typing import Union
-
from plextraktsync.trakt.TraktApi import TraktApi
+ from plextraktsync.trakt.types import TraktMedia
class TraktItem:
- def __init__(self, item: Union[Movie, TVShow, TVSeason, TVEpisode], trakt: TraktApi = None):
+ def __init__(self, item: TraktMedia, trakt: TraktApi = None):
self.item = item
self.trakt = trakt

Use TraktMedia type