          """
          logger.info("Loading file list from %s", self.folder)
          filter_count = 0
          dupe_count = 0
          seen: dict[str, list[int]] = {}
  
          if self._alignments is not None and self._alignments.version < 2.1:  # Legacy updating
              filelist = [os.path.join(self.folder, face)
                          for face in os.listdir(self.folder)
                          if self.valid_extension(face)]
 
</s> remove             meta = dict(alignments=face.to_png_meta(),
                        source=dict(alignments_version=self._alignments.version,
                                    original_filename=output,
                                    face_index=idx,
                                    source_filename=filename,
                                    source_is_video=self._frames.is_video,
                                    source_frame_dims=image.shape[:2]))
 </s> add             meta: PNGHeaderDict = dict(
                alignments=face.to_png_meta(),
                source=dict(alignments_version=self._alignments.version,
                            original_filename=output,
                            face_index=idx,
                            source_filename=filename,
                            source_is_video=self._frames.is_video,
                            source_frame_dims=cast(Tuple[int, int], image.shape[:2])))
            assert face.aligned.face is not None </s> remove         self._changes = {}
 </s> add         self._changes: Dict[str, str] = {} </s> remove                 logger.trace("Next frame not ready. Continuing")  # type: ignore
 </s> add                 logger.trace("Next frame not ready. Continuing")  # type:ignore[attr-defined] </s> remove         list
 </s> add         list[str] </s> remove         logger.trace("Current cache size: %s", len(self.cache))  # type: ignore
 </s> add         logger.trace("Current cache size: %s", len(self.cache))  # type:ignore[attr-defined]
        seen: Dict[str, List[int]] = {}
          """
          logger.info("Loading file list from %s", self.folder)
          filter_count = 0
          dupe_count = 0
        seen: Dict[str, List[int]] = {}
  
          if self._alignments is not None and self._alignments.version < 2.1:  # Legacy updating
              filelist = [os.path.join(self.folder, face)
                          for face in os.listdir(self.folder)
                          if self.valid_extension(face)]
keep keep keep keep replace keep keep keep keep keep
 tests:
  - unit test: tools.alignments.media
  - Add mypy test
  - Typing fixes 
tools/alignments/media.py