'Swaps two tracks in the playlist.'

def cmd_swap(self, conn, i, j):

    i = cast_arg(int, i)
    j = cast_arg(int, j)
    try:
        track_i = self.playlist[i]
        track_j = self.playlist[j]
    except IndexError:
        raise ArgumentIndexError()
    self.playlist[j] = track_i
    self.playlist[i] = track_j
    if (self.current_index == i):
        self.current_index = j
    elif (self.current_index == j):
        self.current_index = i
    self.playlist_version += 1
