Exemplo n.º 1
0
 def __init__(self, plex: PlexApi, trakt: TraktApi, mf: MediaFactory, config: Config):
     self.plex = plex
     self.trakt = trakt
     self.mf = mf
     self.logger = logging.getLogger("PlexTraktSync.WatchStateUpdater")
     self.scrobblers = ScrobblerCollection(trakt, config["watch"]["scrobble_threshold"])
     self.remove_collection = config["watch"]["remove_collection"]
     self.add_collection = config["watch"]["add_collection"]
     if config["watch"]["username_filter"]:
         self.username_filter = config["PLEX_USERNAME"]
     else:
         self.username_filter = None
     self.sessions = SessionCollection(plex)
Exemplo n.º 2
0
 def __init__(self, plex: PlexApi, trakt: TraktApi, mf: MediaFactory,
              config: Config):
     self.plex = plex
     self.trakt = trakt
     self.mf = mf
     self.logger = logging.getLogger("PlexTraktSync.WatchStateUpdater")
     self.threshold = config["watch"]["scrobble_threshold"]
     self.remove_collection = config["watch"]["remove_collection"]
     self.add_collection = config["watch"]["add_collection"]
     if config["watch"]["username_filter"]:
         if not self.plex.has_sessions():
             self.logger.warning(
                 "No permission to access sessions, disabling username filter"
             )
             self.username_filter = None
         else:
             self.username_filter = config["PLEX_USERNAME"]
     else:
         self.username_filter = None
     self.sessions = SessionCollection(plex)
Exemplo n.º 3
0
 def __init__(self, scrobbler: Scrobbler, threshold=80):
     self.scrobbler = scrobbler
     self.threshold = threshold
     self.logger = logging.getLogger("PlexTraktSync.ScrobblerProxy")
Exemplo n.º 4
0
 def __init__(self):
     self.event_listeners = list()
     self.event_factory = EventFactory()
     self.logger = logging.getLogger("PlexTraktSync.EventDispatcher")
Exemplo n.º 5
0
 def __init__(self, plex: PlexServer, poll_interval=5, restart_interval=15):
     self.plex = plex
     self.poll_interval = poll_interval
     self.restart_interval = restart_interval
     self.dispatcher = EventDispatcher()
     self.logger = logging.getLogger("PlexTraktSync.WebSocketListener")