Skip to content

Commit

Permalink
kodi android doesn't support multiprocessing completely, workaround t…
Browse files Browse the repository at this point in the history
…o fix error.
  • Loading branch information
fayer3 committed Dec 7, 2021
1 parent f12be55 commit d0b4401
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.zappntv" name="Zappn TV" version="1.3.4+matrix.1" provider-name="fayer3">
<addon id="plugin.video.zappntv" name="Zappn TV" version="1.3.5+matrix.1" provider-name="fayer3">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.routing" version="0.2.3+matrix.1"/>
Expand Down Expand Up @@ -42,6 +42,8 @@
1.3.4:
- Einstellung hinzugefügt, um immer den Puls4 Key bei abfragen aus der Mediathek zu verwenden. Zum zeitpunkt des releases dieser Version bekommt man somit Videos mit höherer Auflösung
- Einstellung hinzugefügt, um Videos wie der Webplayer auf der prosiebenmaxx Webseite abzurufen. Dies ist langsamer, resultiert aber manchmal mit höher Aufgelösten Videos
1.3.5:
- Fehler mit kodi 19.3 auf Android beim öffnen der LEv Section behoben
</news>
<assets>
<icon>resources/icon.png</icon>
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ v1.3.3:
v1.3.4:
- add option to always use the puls4 request key on vod content. as of release of this version this results in higher resolution videos
- add option to request videos like the player on the prosiebenmaxx website, this is slower, but sometimes gives higher resolution videos
v1.3.5:
- fix error with kodi 19.3 on android, opening the live section

26 changes: 15 additions & 11 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,21 @@ def show_category(category_id):
channels = json.loads(result)
streams = []
if multiprocess:
threads = []
pool = ThreadPool(processes=len(channels['response']['data']))
for brand in channels['response']['data']:
thread = pool.apply_async(get_livestream, (brand['channelId'], brand['title'], brand['id']))
thread.name = brand['channelId']
thread.daemon = True
threads.append(thread)
for thread in threads:
streams.append(thread.get())
pool.close()
pool.join()
try:
threads = []
pool = ThreadPool(processes=len(channels['response']['data']))
for brand in channels['response']['data']:
thread = pool.apply_async(get_livestream, (brand['channelId'], brand['title'], brand['id']))
thread.name = brand['channelId']
thread.daemon = True
threads.append(thread)
for thread in threads:
streams.append(thread.get())
pool.close()
pool.join()
except ImportError as e:
for brand in channels['response']['data']:
streams.append(get_livestream(brand['channelId'], brand['title'], brand['id']))
else:
for brand in channels['response']['data']:
streams.append(get_livestream(brand['channelId'], brand['title'], brand['id']))
Expand Down

0 comments on commit d0b4401

Please sign in to comment.