Fix PKC crashing on Xbox
This commit is contained in:
parent
0c567509eb
commit
6c8b17d7b8
5 changed files with 17 additions and 15 deletions
|
@ -1,9 +1,9 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, unicode_literals
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
|
|
||||||
from .full_sync import start, PLAYLIST_SYNC_ENABLED
|
from .full_sync import start
|
||||||
from .time import sync_pms_time
|
from .time import sync_pms_time
|
||||||
from .websocket import store_websocket_message, process_websocket_messages, \
|
from .websocket import store_websocket_message, process_websocket_messages, \
|
||||||
WEBSOCKET_MESSAGES, PLAYSTATE_SESSIONS
|
WEBSOCKET_MESSAGES, PLAYSTATE_SESSIONS
|
||||||
from .common import update_kodi_library
|
from .common import update_kodi_library, PLAYLIST_SYNC_ENABLED
|
||||||
from .fanart import FanartThread, FanartTask
|
from .fanart import FanartThread, FanartTask
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
from __future__ import absolute_import, division, unicode_literals
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
import xbmc
|
import xbmc
|
||||||
|
|
||||||
from .. import app
|
from .. import app, utils, variables as v
|
||||||
|
|
||||||
|
PLAYLIST_SYNC_ENABLED = (v.PLATFORM != 'Microsoft UWP' and
|
||||||
|
utils.settings('enablePlaylistSync') == 'true')
|
||||||
|
|
||||||
|
|
||||||
class libsync_mixin(object):
|
class libsync_mixin(object):
|
||||||
|
|
|
@ -13,13 +13,9 @@ from .. import utils, timing, backgroundthread, variables as v, app
|
||||||
from .. import plex_functions as PF, itemtypes
|
from .. import plex_functions as PF, itemtypes
|
||||||
from ..plex_db import PlexDB
|
from ..plex_db import PlexDB
|
||||||
|
|
||||||
if (v.PLATFORM != 'Microsoft UWP' and
|
if common.PLAYLIST_SYNC_ENABLED:
|
||||||
utils.settings('enablePlaylistSync') == 'true'):
|
|
||||||
# Xbox cannot use watchdog, a dependency for PKC playlist features
|
|
||||||
from .. import playlists
|
from .. import playlists
|
||||||
PLAYLIST_SYNC_ENABLED = True
|
|
||||||
else:
|
|
||||||
PLAYLIST_SYNC_ENABLED = False
|
|
||||||
|
|
||||||
LOG = getLogger('PLEX.sync.full_sync')
|
LOG = getLogger('PLEX.sync.full_sync')
|
||||||
# How many items will be put through the processing chain at once?
|
# How many items will be put through the processing chain at once?
|
||||||
|
@ -411,7 +407,7 @@ class FullSync(common.fullsync_mixin):
|
||||||
if self.isCanceled():
|
if self.isCanceled():
|
||||||
self.successful = False
|
self.successful = False
|
||||||
return
|
return
|
||||||
if PLAYLIST_SYNC_ENABLED and not playlists.full_sync():
|
if common.PLAYLIST_SYNC_ENABLED and not playlists.full_sync():
|
||||||
self.successful = False
|
self.successful = False
|
||||||
return
|
return
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -3,15 +3,17 @@
|
||||||
from __future__ import absolute_import, division, unicode_literals
|
from __future__ import absolute_import, division, unicode_literals
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from .common import update_kodi_library
|
from .common import update_kodi_library, PLAYLIST_SYNC_ENABLED
|
||||||
from .full_sync import PLAYLIST_SYNC_ENABLED
|
|
||||||
from .fanart import SYNC_FANART, FanartTask
|
from .fanart import SYNC_FANART, FanartTask
|
||||||
from ..plex_api import API
|
from ..plex_api import API
|
||||||
from ..plex_db import PlexDB
|
from ..plex_db import PlexDB
|
||||||
from .. import kodi_db
|
from .. import kodi_db
|
||||||
from .. import backgroundthread, playlists, plex_functions as PF, itemtypes
|
from .. import backgroundthread, plex_functions as PF, itemtypes
|
||||||
from .. import artwork, utils, timing, variables as v, app
|
from .. import artwork, utils, timing, variables as v, app
|
||||||
|
|
||||||
|
if PLAYLIST_SYNC_ENABLED:
|
||||||
|
from .. import playlists
|
||||||
|
|
||||||
LOG = getLogger('PLEX.sync.websocket')
|
LOG = getLogger('PLEX.sync.websocket')
|
||||||
|
|
||||||
CACHING_ENALBED = utils.settings('enableTextureCache') == "true"
|
CACHING_ENALBED = utils.settings('enableTextureCache') == "true"
|
||||||
|
|
|
@ -9,6 +9,9 @@ from . import library_sync, timing
|
||||||
from . import backgroundthread, utils, artwork, variables as v, app
|
from . import backgroundthread, utils, artwork, variables as v, app
|
||||||
from . import kodi_db
|
from . import kodi_db
|
||||||
|
|
||||||
|
if library_sync.PLAYLIST_SYNC_ENABLED:
|
||||||
|
from . import playlists
|
||||||
|
|
||||||
LOG = getLogger('PLEX.sync')
|
LOG = getLogger('PLEX.sync')
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,7 +211,6 @@ class Sync(backgroundthread.KillableThread):
|
||||||
initial_sync_done = True
|
initial_sync_done = True
|
||||||
utils.settings('dbCreatedWithVersion', v.ADDON_VERSION)
|
utils.settings('dbCreatedWithVersion', v.ADDON_VERSION)
|
||||||
if library_sync.PLAYLIST_SYNC_ENABLED:
|
if library_sync.PLAYLIST_SYNC_ENABLED:
|
||||||
from . import playlists
|
|
||||||
playlist_monitor = playlists.kodi_playlist_monitor()
|
playlist_monitor = playlists.kodi_playlist_monitor()
|
||||||
self.start_fanart_download(refresh=False)
|
self.start_fanart_download(refresh=False)
|
||||||
self.start_image_cache_thread()
|
self.start_image_cache_thread()
|
||||||
|
@ -227,7 +229,6 @@ class Sync(backgroundthread.KillableThread):
|
||||||
initial_sync_done = True
|
initial_sync_done = True
|
||||||
LOG.info('Done initial sync on Kodi startup')
|
LOG.info('Done initial sync on Kodi startup')
|
||||||
if library_sync.PLAYLIST_SYNC_ENABLED:
|
if library_sync.PLAYLIST_SYNC_ENABLED:
|
||||||
from . import playlists
|
|
||||||
playlist_monitor = playlists.kodi_playlist_monitor()
|
playlist_monitor = playlists.kodi_playlist_monitor()
|
||||||
self.start_fanart_download(refresh=False)
|
self.start_fanart_download(refresh=False)
|
||||||
self.start_image_cache_thread()
|
self.start_image_cache_thread()
|
||||||
|
|
Loading…
Reference in a new issue