'Set a new Video-On-Demand download. Set the mode of old download to normal and close the file stream of
the old download.'

def set_vod_download(self, new_download):

    if self.vod_download:
        self.vod_download.set_mode(DLMODE_NORMAL)
        vi_dict = self.vod_info.pop(self.vod_download.get_def().get_infohash(), None)
        if (vi_dict and ('stream' in vi_dict)):
            vi_dict['stream'][0].close()
    self.vod_download = new_download
