From 7d8b7346c30550475b477691870bfa12f7782be6 Mon Sep 17 00:00:00 2001 From: Paco8 <5084042+Paco8@users.noreply.github.com> Date: Sat, 30 Mar 2024 23:06:10 +0100 Subject: [PATCH] Version 0.8.18 --- addon.xml | 2 +- resources/lib/plugin.py | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/addon.xml b/addon.xml index 88285b8..86df870 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index c8e99a7..caef1c1 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -212,15 +212,35 @@ def play(params): xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item) LOG('**** session_opened: {}'.format(session_opened)) - if session_opened: + is_sport_channel = (stype == 'tv' and channel_id in ['MLIGA', 'DAZNLI', 'MLIG1', 'CHAPIO', 'CHAP1', 'CHAP2', 'MLIGUH', 'CHAUHD', 'CHUHD1']) + if session_opened or is_sport_channel: + if is_sport_channel: + last_time = 0 #time.time() + window = xbmcgui.Window(12005) + label = xbmcgui.ControlLabel(0, 0, 400, 20, m.account['id'], textColor='0xFFFFFFFF', alignment=6) from .player import MyPlayer player = MyPlayer() monitor = xbmc.Monitor() while not monitor.abortRequested() and player.running: monitor.waitForAbort(10) #LOG('**** waiting') - d = m.delete_session() - LOG('Delete session: d: {}'.format(d)) + if is_sport_channel and player.isPlaying(): + now = time.time() + if now - last_time >= 15*60: + last_time = now + #show_notification(m.account['id'], xbmcgui.NOTIFICATION_INFO) + w = window.getWidth() + h = window.getHeight() + #LOG('window h: {} w: {}'.format(h, w)) + pos_x = w-label.getWidth()-60 + pos_y = h-200 + label.setPosition(pos_x, pos_y) + window.addControl(label) + time.sleep(8) + window.removeControl(label) + if session_opened: + d = m.delete_session() + LOG('Delete session: d: {}'.format(d)) LOG('Playback finished')