def update_progress(self, num_files_processed):
        if self.total_files is None:
            raise ValueError("You need to set total_files before you can update progress.")
        self.processed_files = num_files_processed
        self.progress = int(100 * (float(self.processed_files) / float(self.total_files)))
        if self.progress >= 100:
            self.complete = True
        self.save()
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqmedia/cache.py/BulkMultimediaStatusCache.update_progress/original