Ignore all websocket playlist messages caused by PKC
This commit is contained in:
parent
62ecefdcca
commit
8c51ee5c7a
2 changed files with 7 additions and 7 deletions
|
@ -36,9 +36,6 @@ SUPPORTED_FILETYPES = (
|
||||||
)
|
)
|
||||||
# Avoid endless loops. Store Plex IDs for creating, Kodi paths for deleting!
|
# Avoid endless loops. Store Plex IDs for creating, Kodi paths for deleting!
|
||||||
IGNORE_KODI_PLAYLIST_CHANGE = list()
|
IGNORE_KODI_PLAYLIST_CHANGE = list()
|
||||||
# Used for updating Plex playlists due to Kodi changes - Plex playlist
|
|
||||||
# will have to be deleted first. Add Plex ids!
|
|
||||||
IGNORE_PLEX_PLAYLIST_CHANGE = list()
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,10 +96,10 @@ def websocket(plex_id, status):
|
||||||
plex_id = int(plex_id)
|
plex_id = int(plex_id)
|
||||||
with app.APP.lock_playlists:
|
with app.APP.lock_playlists:
|
||||||
playlist = db.get_playlist(plex_id=plex_id)
|
playlist = db.get_playlist(plex_id=plex_id)
|
||||||
if plex_id in IGNORE_PLEX_PLAYLIST_CHANGE:
|
if plex_id in plex_pl.IGNORE_PLEX_PLAYLIST_CHANGE:
|
||||||
LOG.debug('Ignoring detected Plex playlist change for %s',
|
LOG.debug('Ignoring detected Plex playlist change for %s',
|
||||||
playlist)
|
playlist)
|
||||||
IGNORE_PLEX_PLAYLIST_CHANGE.remove(plex_id)
|
plex_pl.IGNORE_PLEX_PLAYLIST_CHANGE.remove(plex_id)
|
||||||
return
|
return
|
||||||
if playlist and status == 9:
|
if playlist and status == 9:
|
||||||
# Won't be able to download metadata of the deleted playlist
|
# Won't be able to download metadata of the deleted playlist
|
||||||
|
@ -250,7 +247,6 @@ def _full_sync():
|
||||||
LOG.info('Skipping Kodi playlist %s', path)
|
LOG.info('Skipping Kodi playlist %s', path)
|
||||||
else:
|
else:
|
||||||
LOG.debug('Changed Kodi playlist detected: %s', path)
|
LOG.debug('Changed Kodi playlist detected: %s', path)
|
||||||
IGNORE_PLEX_PLAYLIST_CHANGE.append(playlist.plex_id)
|
|
||||||
plex_pl.delete(playlist)
|
plex_pl.delete(playlist)
|
||||||
playlist.kodi_hash = kodi_hash
|
playlist.kodi_hash = kodi_hash
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -10,7 +10,9 @@ from .common import PlaylistError
|
||||||
from . import pms, db
|
from . import pms, db
|
||||||
###############################################################################
|
###############################################################################
|
||||||
LOG = getLogger('PLEX.playlists.plex_pl')
|
LOG = getLogger('PLEX.playlists.plex_pl')
|
||||||
|
# Used for updating Plex playlists due to Kodi changes - Plex playlist
|
||||||
|
# will have to be deleted first. Add Plex ids!
|
||||||
|
IGNORE_PLEX_PLAYLIST_CHANGE = list()
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +30,7 @@ def create(playlist):
|
||||||
if not plex_ids:
|
if not plex_ids:
|
||||||
LOG.warning('No Plex ids found for playlist %s', playlist)
|
LOG.warning('No Plex ids found for playlist %s', playlist)
|
||||||
raise PlaylistError
|
raise PlaylistError
|
||||||
|
IGNORE_PLEX_PLAYLIST_CHANGE.append(playlist.plex_id)
|
||||||
pms.add_items(playlist, plex_ids)
|
pms.add_items(playlist, plex_ids)
|
||||||
db.update_playlist(playlist)
|
db.update_playlist(playlist)
|
||||||
LOG.debug('Done creating Plex playlist %s', playlist)
|
LOG.debug('Done creating Plex playlist %s', playlist)
|
||||||
|
@ -40,5 +43,6 @@ def delete(playlist):
|
||||||
Returns None or raises PlaylistError
|
Returns None or raises PlaylistError
|
||||||
"""
|
"""
|
||||||
LOG.debug('Deleting playlist from PMS: %s', playlist)
|
LOG.debug('Deleting playlist from PMS: %s', playlist)
|
||||||
|
IGNORE_PLEX_PLAYLIST_CHANGE.append(playlist.plex_id)
|
||||||
pms.delete(playlist)
|
pms.delete(playlist)
|
||||||
db.update_playlist(playlist, delete=True)
|
db.update_playlist(playlist, delete=True)
|
||||||
|
|
Loading…
Reference in a new issue