Tell if moving playlist item failed
This commit is contained in:
parent
4d957aa4a3
commit
03fc9a909e
1 changed files with 5 additions and 3 deletions
|
@ -368,7 +368,7 @@ def move_playlist_item(playlist, before_pos, after_pos):
|
||||||
"""
|
"""
|
||||||
Moves playlist item from before_pos [int] to after_pos [int] for Plex only.
|
Moves playlist item from before_pos [int] to after_pos [int] for Plex only.
|
||||||
|
|
||||||
WILL ALSO CHANGE OUR PLAYLISTS
|
WILL ALSO CHANGE OUR PLAYLISTS. Returns True if successful
|
||||||
"""
|
"""
|
||||||
log.debug('Moving item from %s to %s on the Plex side for %s'
|
log.debug('Moving item from %s to %s on the Plex side for %s'
|
||||||
% (before_pos, after_pos, playlist))
|
% (before_pos, after_pos, playlist))
|
||||||
|
@ -383,12 +383,14 @@ def move_playlist_item(playlist, before_pos, after_pos):
|
||||||
playlist.ID,
|
playlist.ID,
|
||||||
playlist.items[before_pos].ID,
|
playlist.items[before_pos].ID,
|
||||||
playlist.items[after_pos - 1].ID)
|
playlist.items[after_pos - 1].ID)
|
||||||
xml = DU().downloadUrl(url, action_type="PUT")
|
|
||||||
# We need to increment the playlistVersion
|
# We need to increment the playlistVersion
|
||||||
_get_playListVersion_from_xml(playlist, xml)
|
if _get_playListVersion_from_xml(
|
||||||
|
playlist, DU().downloadUrl(url, action_type="PUT")) is False:
|
||||||
|
return False
|
||||||
# Move our item's position in our internal playlist
|
# Move our item's position in our internal playlist
|
||||||
playlist.items.insert(after_pos, playlist.items.pop(before_pos))
|
playlist.items.insert(after_pos, playlist.items.pop(before_pos))
|
||||||
log.debug('Done moving for %s' % playlist)
|
log.debug('Done moving for %s' % playlist)
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def get_PMS_playlist(playlist, playlist_id=None):
|
def get_PMS_playlist(playlist, playlist_id=None):
|
||||||
|
|
Loading…
Add table
Reference in a new issue