Skip to content

Commit

Permalink
Merge pull request #1842 from croneter/python3-beta
Browse files Browse the repository at this point in the history
Bump Python 3 master
  • Loading branch information
croneter authored May 28, 2022
2 parents 566c919 + b78e9ed commit f119586
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 11 deletions.
14 changes: 12 additions & 2 deletions 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.plexkodiconnect" name="PlexKodiConnect" version="3.6.12" provider-name="croneter">
<addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="3.6.14" provider-name="croneter">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.22.0+matrix.1" />
Expand Down Expand Up @@ -93,7 +93,17 @@
<summary lang="ko_KR">Plex를 Kodi에 기본 통합</summary>
<description lang="ko_KR">Kodi를 Plex Media Server에 연결합니다. 이 플러그인은 Plex로 모든 비디오를 관리하고 Kodi로는 관리하지 않는다고 가정합니다. Kodi 비디오 및 음악 데이터베이스에 이미 저장된 데이터가 손실 될 수 있습니다 (이 플러그인이 직접 변경하므로). 자신의 책임하에 사용하십시오!</description>
<disclaimer lang="ko_KR">자신의 책임하에 사용</disclaimer>
<news>version 3.6.12:
<news>version 3.6.14:
- Make PKC compatible with latest Kodi Nexus #1840
- Fix TypeError: 'NoneType' object is not subscriptable on playback start #1839
- version 3.6.13 for everyone

version 3.6.13 (beta only):
- Fix TypeError: 'NoneType' object is not subscriptable on playback start #1823
- Add initial, experimental support for latest Nexus nightly, video DB version bump 120 #1824
- Fix RuntimeError: dictionary changed size during iteration if Plex Companion subscribers change #1825

version 3.6.12:
- version 3.6.11 for everyone

version 3.6.11 (beta only):
Expand Down
10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
version 3.6.14:
- Make PKC compatible with latest Kodi Nexus #1840
- Fix TypeError: 'NoneType' object is not subscriptable on playback start #1839
- version 3.6.13 for everyone

version 3.6.13 (beta only):
- Fix TypeError: 'NoneType' object is not subscriptable on playback start #1823
- Add initial, experimental support for latest Nexus nightly, video DB version bump 120 #1824
- Fix RuntimeError: dictionary changed size during iteration if Plex Companion subscribers change #1825

version 3.6.12:
- version 3.6.11 for everyone

Expand Down
2 changes: 1 addition & 1 deletion resources/lib/json_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def get_current_subtitle_stream_index(playerid):
return JsonRPC('Player.GetProperties').execute({
'playerid': playerid,
'properties': ['currentsubtitle', ]})['result']['currentsubtitle']['index']
except KeyError:
except (KeyError, TypeError):
pass


Expand Down
20 changes: 18 additions & 2 deletions resources/lib/kodimonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

LOG = getLogger('PLEX.kodimonitor')

WAIT_BEFORE_INIT_STREAMS = 6
ADDITIONAL_WAIT_BEFORE_INIT_STREAMS = 10


class KodiMonitor(xbmc.Monitor):
"""
Expand Down Expand Up @@ -621,6 +624,19 @@ def __init__(self, item):
super().__init__()

def run(self):
if app.APP.monitor.waitForAbort(5):
if app.APP.monitor.waitForAbort(WAIT_BEFORE_INIT_STREAMS):
return
self.item.init_streams()
i = 0
while True:
try:
self.item.init_streams()
except Exception as err:
i += 1
if app.APP.monitor.waitForAbort(1):
return
if i > ADDITIONAL_WAIT_BEFORE_INIT_STREAMS:
LOG.error('Exception encountered while init streams:')
LOG.error(err)
return
else:
break
1 change: 1 addition & 0 deletions resources/lib/playlist_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def init_streams(self):
if utils.settings('subtitleStreamPick') == '0':
self.switch_to_plex_stream('subtitle')
self.streams_initialized = True
LOG.debug('Successfully initialized streams')

def init_kodi_streams(self):
self._current_kodi_video_stream = self._current_index('video')
Expand Down
12 changes: 7 additions & 5 deletions resources/lib/plex_companion/playstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ def _close_requests_session(self):

def close_connections(self):
"""May also be called from another thread"""
self._stop_webserver()
self._close_requests_session()
self.subscribers = dict()
with app.APP.lock_subscriber:
self._stop_webserver()
self._close_requests_session()
self.subscribers = dict()

def send_stop(self):
"""
Expand Down Expand Up @@ -160,8 +161,9 @@ def companion_timeline(self, message):
for entry in message:
if entry.get('state') != 'stopped':
state = entry.get('state')
for subscriber in self.subscribers.values():
subscriber.send_timeline(message, state)
with app.APP.lock_subscriber:
for subscriber in self.subscribers.values():
subscriber.send_timeline(message, state)

def pms_timeline_per_player(self, playerid, message):
"""
Expand Down
3 changes: 2 additions & 1 deletion resources/lib/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@
MIN_DB_VERSION = '3.2.1'

# Supported databases - version numbers in tuples should decrease
# See https://github.com/xbmc/xbmc/blob/master/xbmc/video/VideoDatabase.cpp
SUPPORTED_VIDEO_DB = {
19: (119, ),
20: (119, ),
20: (119, 120, 121),
}
SUPPORTED_MUSIC_DB = {
19: (82, ),
Expand Down

0 comments on commit f119586

Please sign in to comment.