From 9b140a77d3d883550e79c0565912e89c5102c897 Mon Sep 17 00:00:00 2001 From: Famille Bollu Date: Thu, 26 Jul 2018 19:32:37 +0200 Subject: [PATCH] Revert "Will use a downloader thread directly from peertube.py. Will not use a service anymore." This reverts commit 5f590f48cd861fd4d17d2ed9c47a4b2a478ca7cd. In the end, a service is needed: The addon is ended when kodi starts playing the file, so the downloader thread would be ended also. I need to launch the downloader thread from something that isn't expected to end, which is why services exist. --- addon.xml | 2 ++ service.py | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 service.py diff --git a/addon.xml b/addon.xml index 554cbf8..4020ecb 100644 --- a/addon.xml +++ b/addon.xml @@ -6,6 +6,8 @@ video + + Plugin for PeerTube PeerTube is a federated open source alternative to YouTube diff --git a/service.py b/service.py new file mode 100644 index 0000000..522663b --- /dev/null +++ b/service.py @@ -0,0 +1,10 @@ +import time +import xbmc + +if __name__ == '__main__': + monitor = xbmc.Monitor() + + while not monitor.abortRequested(): + if monitor.waitForAbort(1): + # Abort was requested while waiting. We must exit + break