Rename function

This commit is contained in:
Croneter 2018-05-01 18:08:31 +02:00
parent 6c3c9a4f93
commit ba0aff0f54
4 changed files with 7 additions and 6 deletions

View file

@ -384,7 +384,7 @@ class KodiMonitor(xbmc.Monitor):
LOG.debug('No Plex id obtained - aborting playback report') LOG.debug('No Plex id obtained - aborting playback report')
state.PLAYER_STATES[playerid] = copy.deepcopy(state.PLAYSTATE) state.PLAYER_STATES[playerid] = copy.deepcopy(state.PLAYSTATE)
return return
item = PL.init_Plex_playlist(playqueue, plex_id=plex_id) item = PL.init_plex_playqueue(playqueue, plex_id=plex_id)
# Set the Plex container key (e.g. using the Plex playqueue) # Set the Plex container key (e.g. using the Plex playqueue)
container_key = None container_key = None
if info['playlistid'] != -1: if info['playlistid'] != -1:

View file

@ -207,7 +207,7 @@ def _init_existing_kodi_playlist(playqueue, pos):
kodi_items = js.playlist_get_items(playqueue.playlistid) kodi_items = js.playlist_get_items(playqueue.playlistid)
if not kodi_items: if not kodi_items:
raise PL.PlaylistError('No Kodi items returned') raise PL.PlaylistError('No Kodi items returned')
item = PL.init_Plex_playlist(playqueue, kodi_item=kodi_items[pos]) item = PL.init_plex_playqueue(playqueue, kodi_item=kodi_items[pos])
item.force_transcode = state.FORCE_TRANSCODE item.force_transcode = state.FORCE_TRANSCODE
# playqueue.py will add the rest - this will likely put the PMS under # playqueue.py will add the rest - this will likely put the PMS under
# a LOT of strain if the following Kodi setting is enabled: # a LOT of strain if the following Kodi setting is enabled:

View file

@ -456,7 +456,7 @@ def update_playlist_from_PMS(playlist, playlist_id=None, xml=None):
playlist.items.append(playlist_item) playlist.items.append(playlist_item)
def init_Plex_playlist(playlist, plex_id=None, kodi_item=None): def init_plex_playqueue(playlist, plex_id=None, kodi_item=None):
""" """
Initializes the Plex side without changing the Kodi playlists Initializes the Plex side without changing the Kodi playlists
WILL ALSO UPDATE OUR PLAYLISTS. WILL ALSO UPDATE OUR PLAYLISTS.
@ -503,7 +503,7 @@ def add_listitem_to_playlist(playlist, pos, listitem, kodi_id=None,
'%s', pos, playlist) '%s', pos, playlist)
kodi_item = {'id': kodi_id, 'type': kodi_type, 'file': file} kodi_item = {'id': kodi_id, 'type': kodi_type, 'file': file}
if playlist.id is None: if playlist.id is None:
init_Plex_playlist(playlist, plex_id, kodi_item) init_plex_playqueue(playlist, plex_id, kodi_item)
else: else:
add_item_to_PMS_playlist(playlist, pos, plex_id, kodi_item) add_item_to_PMS_playlist(playlist, pos, plex_id, kodi_item)
if kodi_id is None and playlist.items[pos].kodi_id: if kodi_id is None and playlist.items[pos].kodi_id:
@ -532,7 +532,7 @@ def add_item_to_playlist(playlist, pos, kodi_id=None, kodi_type=None,
LOG.debug('add_item_to_playlist. Playlist before adding: %s', playlist) LOG.debug('add_item_to_playlist. Playlist before adding: %s', playlist)
kodi_item = {'id': kodi_id, 'type': kodi_type, 'file': file} kodi_item = {'id': kodi_id, 'type': kodi_type, 'file': file}
if playlist.id is None: if playlist.id is None:
item = init_Plex_playlist(playlist, plex_id, kodi_item) item = init_plex_playqueue(playlist, plex_id, kodi_item)
else: else:
item = add_item_to_PMS_playlist(playlist, pos, plex_id, kodi_item) item = add_item_to_PMS_playlist(playlist, pos, plex_id, kodi_item)
params = { params = {

View file

@ -189,7 +189,8 @@ class PlayqueueMonitor(Thread):
with LOCK: with LOCK:
try: try:
if playqueue.id is None: if playqueue.id is None:
PL.init_Plex_playlist(playqueue, kodi_item=new_item) PL.init_plex_playqueue(playqueue,
kodi_item=new_item)
else: else:
PL.add_item_to_PMS_playlist(playqueue, PL.add_item_to_PMS_playlist(playqueue,
i, i,