Add type hint for Media.plex
MODIFY
plextraktsync/media.py
plextraktsync/media.py
from plextraktsync.plex.PlexLibraryItem import PlexLibraryItem
from plextraktsync.trakt.TraktApi import TraktApi
from plextraktsync.trakt.TraktItem import TraktItem
+ from plextraktsync.trakt.types import TraktMedia
class Media:
"""
Class containing Plex and Trakt media items (Movie, Episode)
"""
+ trakt: TraktMedia
plex: PlexLibraryItem
def __init__(
@@ -202,8 +204,11 @@ def plex_history(self, **kwargs):
return self.plex_api.history(self.plex.item, **kwargs)
def __str__(self):
+ if self.plex:
return str(self.plex)
+ return str(self.trakt)
+
class MediaFactory:
"""

Add type hint for Media.plex