'Move a track in the playlist.'

def cmd_move(self, conn, idx_from, idx_to):

    idx_from = cast_arg(int, idx_from)
    idx_to = cast_arg(int, idx_to)
    try:
        track = self.playlist.pop(idx_from)
        self.playlist.insert(idx_to, track)
    except IndexError:
        raise ArgumentIndexError()
    if (idx_from == self.current_index):
        self.current_index = idx_to
    elif (idx_from < self.current_index <= idx_to):
        self.current_index -= 1
    elif (idx_from > self.current_index >= idx_to):
        self.current_index += 1
    self.playlist_version += 1
