U ë{dÙã@spddlmZmZmZddlmZddlZddlZe d¡Ze  d¡Z Gdd„deƒZ Gdd „d eƒZ d d „Z dS) é)ÚMonitorÚPlayerÚ getInfoLabel)ÚProxyNzplugin.video.nhlstreamsÚ proxyportc@s eZdZdZdd„Zdd„ZdS)ÚBackgroundServicez Background service code cCst |¡tƒ|_d|_dS)N)rÚ__init__Ú PlayerMonitorZ_playerÚ _proxy_thread©Úself©r ús/storage/emulated/0/Android/data/benim.Lokum.TV/files/.kodi/addons/plugin.video.nhlstreams/resources/lib/service.pyrs zBackgroundService.__init__cCsHt dd¡t ¡|_| ¡s,| d¡rq,q|jrD|j ¡rDt ¡dS)z' Background loop for maintenance tasks rNé ) ÚaddonÚ setSettingrÚstartr ÚabortRequestedÚ waitForAbortÚis_aliveÚstopr r r rÚruns   zBackgroundService.runN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr r r rr src@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) r z+ A custom Player object to check subtitles cCsd|_d|_t |¡dS)z$ Initialises a custom Player object FN)Ú_PlayerMonitor__listenÚ_PlayerMonitor__pathrrr r r rr(szPlayerMonitor.__init__cCs:tdƒ|_|j d¡s d|_dStjdtjdd|_dS)z( Will be called when Kodi player starts zPlayer.FilenameAndPathz!plugin://plugin.video.nhlstreams/FNzstart odtwarzaniax©ÚlevelT)rrÚ startswithrÚxbmcÚlogÚLOGINFOr r r rÚonPlayBackStarted0s   zPlayerMonitor.onPlayBackStartedcCs|js dStjdtjddS)z1 Will be called when [Kodi] stops playing a file Nzkoniec odtwarzaniaxr©rr!r"r#r r r rÚonPlayBackEnded9szPlayerMonitor.onPlayBackEndedcCs|js dStjdtjddS)z6 Will be called when [user] stops Kodi playing a file Nzkoniec odtwarzaniax2rr%r r r rÚonPlayBackStopped@szPlayerMonitor.onPlayBackStoppedN)rrrrrr$r&r'r r r rr %s  r cCstƒ ¡dS)z Run the BackgroundService N)rrr r r rrFsr)r!rrrZresources.lib.proxyrÚ xbmcaddonÚAddonrÚ getSettingrrr rr r r rÚs   !