f-lawe / plugin.video.orange.fr

Orange TV France for Kodi
MIT License
48 stars 18 forks source link

Crash on Catchup #55

Closed bateast closed 1 month ago

bateast commented 1 month ago

Après avoir mis à jour la gestion d’InputStream helper , j’ai un crash de Kodi sur le lancement d’un stream CatchUp:

Cela se produit uniquement lors du lancement distant (API JSON) — Yatse, interface Web… Ce qui se voit dans les logs ↓.

2024-07-23 16:02:16.339 T:4408    debug <CWebserver[80]>: request received for /jsonrpc
2024-07-23 16:02:17.423 T:4147    debug <general>: Skipped 4 duplicate messages..
2024-07-23 16:02:17.423 T:4147    debug <general>: CScriptRunner: running add-on script Orange TV France('plugin://plugin.video.orange.fr/videos/FR2CU125936', '5', '')
2024-07-23 16:02:17.423 T:4411    debug <general>: Thread LanguageInvoker start, auto delete: false
2024-07-23 16:02:17.424 T:4411    debug <general>: initializing python engine.
2024-07-23 16:02:17.424 T:4411    debug <general>: CPythonInvoker(21, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): start processing
2024-07-23 16:02:17.444 T:4412    debug <general>: Thread ScriptObs start, auto delete: false
2024-07-23 16:02:17.569 T:4411    debug <general>: -->Python Interpreter Initialized<--
2024-07-23 16:02:17.569 T:4411    debug <general>:

2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): the source file to load is "/home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py"
2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21): full python path:
2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21):   custom python path:
2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21):     /home/osmc/.kodi/addons/plugin.video.orange.fr/resources
2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21):     /home/osmc/.kodi/addons/script.module.inputstreamhelper/lib
2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21):     /home/osmc/.kodi/addons/script.module.pysocks/lib
2024-07-23 16:02:17.569 T:4411    debug <general>: CPythonInvoker(21):     /home/osmc/.kodi/addons/script.module.routing/lib
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):   default python path:
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):     /usr/lib/python39.zip
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):     /usr/lib/python3.9
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):     /usr/lib/python3.9/lib-dynload
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):     /usr/local/lib/python3.9/dist-packages
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):     /usr/lib/python3/dist-packages
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21): adding args:
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):  plugin://plugin.video.orange.fr/videos/FR2CU125936
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):  5
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21):  resume:false
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): entering source directory /home/osmc/.kodi/addons/plugin.video.orange.fr/resources
2024-07-23 16:02:17.570 T:4411    debug <general>: CPythonInvoker(21, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): instantiating addon using automatically obtained id of "plugin.video.orange.fr" dependent on version 3.0.1 of the xbmc.python api
2024-07-23 16:02:17.644 T:4147    debug <general>: ------ Window Init (DialogBusy.xml) ------
2024-07-23 16:02:17.895 T:4410    debug <CWebserver[80]>: request received for /jsonrpc
2024-07-23 16:02:18.598 T:4411    debug <CAddonSettings[0@plugin.video.orange.fr]>: Skipped 1 duplicate messages..
2024-07-23 16:02:18.598 T:4411    debug <CAddonSettings[0@plugin.video.orange.fr]>: trying to load setting definitions from old format...
2024-07-23 16:02:18.600 T:4411    debug <CSettingsManager>: requested setting (basic.enabled) was not found.2024-07-23 16:02:18.775 T:4411    debug <general>: [plugin.video.orange.fr] 3.9.2 (default, Feb 28 2021, 17:03:44)
                                                   [GCC 10.2.1 20210110]
2024-07-23 16:02:18.776 T:4411    debug <general>: [plugin.video.orange.fr][routing] Dispatching to 'video', args: {'video_id': 'FR2CU125936'}
2024-07-23 16:02:18.776 T:4411     info <general>: [plugin.video.orange.fr] Loading catchup video FR2CU125936
2024-07-23 16:02:18.777 T:4411    debug <general>: [plugin.video.orange.fr] Addon router initialized
2024-07-23 16:02:18.777 T:4411    debug <general>: CPythonInvoker(21, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): script successfully run
2024-07-23 16:02:18.778 T:4411    debug <general>: onExecutionDone(21, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py)
2024-07-23 16:02:18.792 T:4147    debug <general>: CScriptRunner: running add-on script Orange TV France('plugin://plugin.video.orange.fr/catchup-streams/FR2CU125936', '6', '')
2024-07-23 16:02:18.794 T:4413    debug <general>: Thread LanguageInvoker start, auto delete: false
2024-07-23 16:02:18.794 T:4413    debug <general>: initializing python engine.
2024-07-23 16:02:18.794 T:4413    debug <general>: CPythonInvoker(22, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): start processing
2024-07-23 16:02:18.814 T:4414    debug <general>: Thread ScriptObs start, auto delete: false
2024-07-23 16:02:18.847 T:4411    debug <general>: Python interpreter stopped
2024-07-23 16:02:18.847 T:4411    debug <general>: Thread LanguageInvoker 3353862400 terminating
2024-07-23 16:02:18.854 T:4412    debug <general>: Thread ScriptObs 3980939520 terminating
2024-07-23 16:02:18.981 T:4413    debug <general>: -->Python Interpreter Initialized<--
2024-07-23 16:02:18.982 T:4413    debug <general>:

2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): the source file to load is "/home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py"
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22): full python path:
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):   custom python path:
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /home/osmc/.kodi/addons/plugin.video.orange.fr/resources
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /home/osmc/.kodi/addons/script.module.inputstreamhelper/lib
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /home/osmc/.kodi/addons/script.module.pysocks/lib
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /home/osmc/.kodi/addons/script.module.routing/lib
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):   default python path:
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /usr/lib/python39.zip
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /usr/lib/python3.9
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /usr/lib/python3.9/lib-dynload
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /usr/local/lib/python3.9/dist-packages
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):     /usr/lib/python3/dist-packages
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22): adding args:
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):  plugin://plugin.video.orange.fr/catchup-streams/FR2CU125936
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):  6
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22):  resume:false
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): entering source directory /home/osmc/.kodi/addons/plugin.video.orange.fr/resources
2024-07-23 16:02:18.982 T:4413    debug <general>: CPythonInvoker(22, /home/osmc/.kodi/addons/plugin.video.orange.fr/resources/addon.py): instantiating addon using automatically obtained id of "plugin.video.orange.fr" dependent on version 3.0.1 of the xbmc.python api
2024-07-23 16:02:19.015 T:4147  critical <general>: Logic error due to two concurrent busydialogs, this is a known issue. The application will exit.
f-lawe commented 1 month ago

C'est bien quand tu es sur ta branche avec la mise à jour de la conf de InputStream ? Est-ce qu'on ne garderait pas dans un premier temps les deux méthodes en parallèle, la nouvelle pour le live et l'ancienne pour le catchup ?

bateast commented 1 month ago

Je ne peux pas tester en dehors de ma branche, le catchup ne fonctionne pas pour moi sans la màj de l’appel à InputStream…

Vu les logs (et le comportement: cela fonctionne lors d’une sélection direct via le gui Kodi, mais pas en appel API JSON), j’ai l’impression que ce n’est pas lié.

f-lawe commented 1 month ago

Est-ce que tu arrives à lancer la vidéo en passant directement sur la route qui est appelée après dans le processus catchup_streams() plutôt que video() ?

C'est peut-être une mauvaise implémentation de ma part. Je n'ai pas trouvé mieux pour le moment pour lancer une vidéo depuis l'interface graphique que de forcer l'ouverture d'un ListItem. Peut-être que si le ListItem de la vidéo est mieux configuré, il peut pointer directement sur catchup_streams() sans le passage rapide par video(). C'est quelque chose que je peux tester rapidement dans la soirée.

f-lawe commented 1 month ago

Ok, j'ai pas mal amélioré le processus. Je relis ma PR, et je l'envoie (il y a d'autres améliorations avec, et dans tous les cas ça allaège le code). En attendant, tu peux essayer de rebaser ta branche sur la mienne pour voir ce que ça donne.

bateast commented 1 month ago

Ça fonctionne. Merci.

f-lawe commented 1 month ago

Ok. Je reprends les PR dans la journée et je clôture tout ça. Merci pour les retours !

f-lawe commented 1 month ago

@bateast Je me suis rendu compte qu'on avait en fait l'utilisation de helper InputStream dans un autre fichier, mais qu'on lui passait les mauvais paramètres. J'ai une nouvelle fois repris le sujet, en séparant dans utils/gui.py uniquement la création des ListItem et la logique autour (est-ce qu'on a les bonnes infos, est-ce qu'on arrive à charger InputStream, etc.) dans managers/StreamManager.py. On gère également une sortie plus propre s'il y a une erreur quand on lance une lecture. Et enfin, un peu de cosmétique, j'ai repris les termes list_item/play_item de l'exemple que tu m'as envoyé, c'est plus lisible.

Est-ce que tu peux faire des tests une dernière fois sur la branche pour confirmer que c'est ok ?

f-lawe commented 1 month ago

Corrigé en 2.1.4