Merge branch 'beta-version'

This commit is contained in:
croneter 2018-08-05 18:15:30 +02:00
commit 7a2752f4b0
9 changed files with 24 additions and 18 deletions

View file

@ -1,5 +1,5 @@
[![stable version](https://img.shields.io/badge/stable_version-2.3.3-blue.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/stable/repository.plexkodiconnect/repository.plexkodiconnect-1.0.2.zip) [![stable version](https://img.shields.io/badge/stable_version-2.3.3-blue.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/stable/repository.plexkodiconnect/repository.plexkodiconnect-1.0.2.zip)
[![beta version](https://img.shields.io/badge/beta_version-2.3.4-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip) [![beta version](https://img.shields.io/badge/beta_version-2.3.5-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip)
[![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/Installation) [![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/Installation)
[![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq) [![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq)

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="2.3.4" provider-name="croneter"> <addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="2.3.5" provider-name="croneter">
<requires> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.requests" version="2.9.1" /> <import addon="script.module.requests" version="2.9.1" />
@ -73,7 +73,10 @@
<summary lang="uk_UA">Нативна інтеграція Plex в Kodi</summary> <summary lang="uk_UA">Нативна інтеграція Plex в Kodi</summary>
<description lang="uk_UA">Підключає Kodi до серверу Plex. Цей плагін передбачає, що ви керуєте всіма своїми відео за допомогою Plex (і ніяк не Kodi). Ви можете втратити дані, які вже зберігаються у відео та музичних БД Kodi (оскільки цей плагін безпосередньо їх змінює). Використовуйте на свій страх і ризик!</description> <description lang="uk_UA">Підключає Kodi до серверу Plex. Цей плагін передбачає, що ви керуєте всіма своїми відео за допомогою Plex (і ніяк не Kodi). Ви можете втратити дані, які вже зберігаються у відео та музичних БД Kodi (оскільки цей плагін безпосередньо їх змінює). Використовуйте на свій страх і ризик!</description>
<disclaimer lang="uk_UA">Використовуйте на свій ризик</disclaimer> <disclaimer lang="uk_UA">Використовуйте на свій ризик</disclaimer>
<news>version 2.3.4 (beta only): <news>version 2.3.5 (beta only):
- Fix PKC not starting by importing playlist module only when sync enabled
version 2.3.4 (beta only):
- Fix playback sometimes not starting and UnicodeEncodeError for logging - Fix playback sometimes not starting and UnicodeEncodeError for logging
version 2.3.3: version 2.3.3:

View file

@ -1,3 +1,6 @@
version 2.3.5 (beta only):
- Fix PKC not starting by importing playlist module only when sync enabled
version 2.3.4 (beta only): version 2.3.4 (beta only):
- Fix playback sometimes not starting and UnicodeEncodeError for logging - Fix playback sometimes not starting and UnicodeEncodeError for logging

View file

@ -110,7 +110,7 @@ msgstr ""
# PKC settings sync options # PKC settings sync options
msgctxt "#30020" msgctxt "#30020"
msgid "Sync Plex playlists" msgid "Sync Plex playlists (reboot Kodi!)"
msgstr "" msgstr ""
# PKC settings sync options # PKC settings sync options

View file

@ -51,7 +51,6 @@ STATE_SETTINGS = {
'forceReloadSkinOnPlaybackStop': 'FORCE_RELOAD_SKIN', 'forceReloadSkinOnPlaybackStop': 'FORCE_RELOAD_SKIN',
'fetch_pms_item_number': 'FETCH_PMS_ITEM_NUMBER', 'fetch_pms_item_number': 'FETCH_PMS_ITEM_NUMBER',
'imageSyncNotifications': 'IMAGE_SYNC_NOTIFICATIONS', 'imageSyncNotifications': 'IMAGE_SYNC_NOTIFICATIONS',
'enablePlaylistSync': 'SYNC_PLAYLISTS',
'syncSpecificPlexPlaylists': 'SYNC_SPECIFIC_PLEX_PLAYLISTS', 'syncSpecificPlexPlaylists': 'SYNC_SPECIFIC_PLEX_PLAYLISTS',
'syncSpecificKodiPlaylists': 'SYNC_SPECIFIC_KODI_PLAYLISTS' 'syncSpecificKodiPlaylists': 'SYNC_SPECIFIC_KODI_PLAYLISTS'
} }

View file

@ -20,10 +20,16 @@ from . import plex_functions as PF
from .plex_api import API from .plex_api import API
from .library_sync import get_metadata, process_metadata, fanart, sync_info from .library_sync import get_metadata, process_metadata, fanart, sync_info
from . import music from . import music
from . import playlists
from . import variables as v from . import variables as v
from . import state from . import state
if utils.settings('enablePlaylistSync') == 'true':
# Xbox cannot use watchdog, a dependency for PKC playlist features
from . import playlists
PLAYLIST_SYNC_ENABLED = True
else:
PLAYLIST_SYNC_ENABLED = False
############################################################################### ###############################################################################
LOG = getLogger('PLEX.librarysync') LOG = getLogger('PLEX.librarysync')
@ -265,7 +271,7 @@ class LibrarySync(Thread):
repair) repair)
if not self._full_sync(): if not self._full_sync():
return False return False
if not playlists.full_sync(): if PLAYLIST_SYNC_ENABLED and not playlists.full_sync():
return False return False
return True return True
@ -1186,7 +1192,7 @@ class LibrarySync(Thread):
continue continue
status = int(item['state']) status = int(item['state'])
if typus == 'playlist': if typus == 'playlist':
if not state.SYNC_PLAYLISTS: if not PLAYLIST_SYNC_ENABLED:
continue continue
playlists.websocket(plex_id=unicode(item['itemID']), playlists.websocket(plex_id=unicode(item['itemID']),
status=status) status=status)
@ -1560,6 +1566,7 @@ class LibrarySync(Thread):
initial_sync_done = True initial_sync_done = True
kodi_db_version_checked = True kodi_db_version_checked = True
last_sync = utils.unix_timestamp() last_sync = utils.unix_timestamp()
if PLAYLIST_SYNC_ENABLED:
playlist_monitor = playlists.kodi_playlist_monitor() playlist_monitor = playlists.kodi_playlist_monitor()
self.sync_fanart() self.sync_fanart()
self.fanartthread.start() self.fanartthread.start()
@ -1612,6 +1619,7 @@ class LibrarySync(Thread):
initial_sync_done = True initial_sync_done = True
last_sync = utils.unix_timestamp() last_sync = utils.unix_timestamp()
LOG.info('Done initial sync on Kodi startup') LOG.info('Done initial sync on Kodi startup')
if PLAYLIST_SYNC_ENABLED:
playlist_monitor = playlists.kodi_playlist_monitor() playlist_monitor = playlists.kodi_playlist_monitor()
artwork.Artwork().cache_major_artwork() artwork.Artwork().cache_major_artwork()
self.sync_fanart() self.sync_fanart()

View file

@ -113,9 +113,6 @@ def full_sync():
Full sync of playlists between Kodi and Plex. Returns True is successful, Full sync of playlists between Kodi and Plex. Returns True is successful,
False otherwise False otherwise
""" """
if not state.SYNC_PLAYLISTS:
LOG.debug('Not syncing playlists')
return True
LOG.info('Starting playlist full sync') LOG.info('Starting playlist full sync')
with state.LOCK_PLAYLISTS: with state.LOCK_PLAYLISTS:
return _full_sync() return _full_sync()
@ -282,9 +279,6 @@ class PlaylistEventhandler(events.FileSystemEventHandler):
:type event: :type event:
:class:`FileSystemEvent` :class:`FileSystemEvent`
""" """
if not state.SYNC_PLAYLISTS:
# Sync is deactivated
return
path = event.dest_path if event.event_type == events.EVENT_TYPE_MOVED \ path = event.dest_path if event.event_type == events.EVENT_TYPE_MOVED \
else event.src_path else event.src_path
if not sync_kodi_playlist(path): if not sync_kodi_playlist(path):

View file

@ -58,6 +58,7 @@ class Service():
utils.settings('syncThreadNumber')) utils.settings('syncThreadNumber'))
LOG.info('Playlist m3u encoding: %s', v.M3U_ENCODING) LOG.info('Playlist m3u encoding: %s', v.M3U_ENCODING)
LOG.info("Full sys.argv received: %s", sys.argv) LOG.info("Full sys.argv received: %s", sys.argv)
LOG.info('Sync playlists: %s', utils.settings('enablePlaylistSync'))
LOG.info('Synching only specific Kodi playlists: %s', LOG.info('Synching only specific Kodi playlists: %s',
utils.settings('syncSpecificKodiPlaylists') == 'true') utils.settings('syncSpecificKodiPlaylists') == 'true')
LOG.info('Kodi playlist prefix: %s', LOG.info('Kodi playlist prefix: %s',

View file

@ -57,8 +57,6 @@ FORCE_RELOAD_SKIN = True
SYNC_DIALOG = True SYNC_DIALOG = True
# Shall Kodi show dialogs for syncing/caching images? (e.g. images left to sync) # Shall Kodi show dialogs for syncing/caching images? (e.g. images left to sync)
IMAGE_SYNC_NOTIFICATIONS = True IMAGE_SYNC_NOTIFICATIONS = True
# Sync playlists from Plex to Kodi and vice-versa?
SYNC_PLAYLISTS = True
# Only sync specific Plex playlists to Kodi? # Only sync specific Plex playlists to Kodi?
SYNC_SPECIFIC_PLEX_PLAYLISTS = False SYNC_SPECIFIC_PLEX_PLAYLISTS = False
# Only sync specific Kodi playlists to Plex? # Only sync specific Kodi playlists to Plex?