From ba0aff0f54ec9ade54151222e9ccaf6d9695e4f3 Mon Sep 17 00:00:00 2001 From: Croneter Date: Tue, 1 May 2018 18:08:31 +0200 Subject: [PATCH] Rename function --- resources/lib/kodimonitor.py | 2 +- resources/lib/playback.py | 2 +- resources/lib/playlist_func.py | 6 +++--- resources/lib/playqueue.py | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index a35af585..e8b960db 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -384,7 +384,7 @@ class KodiMonitor(xbmc.Monitor): LOG.debug('No Plex id obtained - aborting playback report') state.PLAYER_STATES[playerid] = copy.deepcopy(state.PLAYSTATE) 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) container_key = None if info['playlistid'] != -1: diff --git a/resources/lib/playback.py b/resources/lib/playback.py index fe7c9c1a..38439365 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -207,7 +207,7 @@ def _init_existing_kodi_playlist(playqueue, pos): kodi_items = js.playlist_get_items(playqueue.playlistid) if not kodi_items: 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 # playqueue.py will add the rest - this will likely put the PMS under # a LOT of strain if the following Kodi setting is enabled: diff --git a/resources/lib/playlist_func.py b/resources/lib/playlist_func.py index 1baa9403..a76599a7 100644 --- a/resources/lib/playlist_func.py +++ b/resources/lib/playlist_func.py @@ -456,7 +456,7 @@ def update_playlist_from_PMS(playlist, playlist_id=None, xml=None): 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 WILL ALSO UPDATE OUR PLAYLISTS. @@ -503,7 +503,7 @@ def add_listitem_to_playlist(playlist, pos, listitem, kodi_id=None, '%s', pos, playlist) kodi_item = {'id': kodi_id, 'type': kodi_type, 'file': file} if playlist.id is None: - init_Plex_playlist(playlist, plex_id, kodi_item) + init_plex_playqueue(playlist, plex_id, kodi_item) else: add_item_to_PMS_playlist(playlist, pos, plex_id, kodi_item) 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) kodi_item = {'id': kodi_id, 'type': kodi_type, 'file': file} if playlist.id is None: - item = init_Plex_playlist(playlist, plex_id, kodi_item) + item = init_plex_playqueue(playlist, plex_id, kodi_item) else: item = add_item_to_PMS_playlist(playlist, pos, plex_id, kodi_item) params = { diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 3bf8a61b..d6a0d02a 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -189,7 +189,8 @@ class PlayqueueMonitor(Thread): with LOCK: try: if playqueue.id is None: - PL.init_Plex_playlist(playqueue, kodi_item=new_item) + PL.init_plex_playqueue(playqueue, + kodi_item=new_item) else: PL.add_item_to_PMS_playlist(playqueue, i,