Skip to content

Commit

Permalink
Merge pull request #57 from shaunhwq/fix_repeat_not_subscriptable
Browse files Browse the repository at this point in the history
fix: repeat obj not subscriptable
  • Loading branch information
shaunhwq authored May 28, 2024
2 parents 3480429 + d20cf8a commit 1cddf9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions visual_comparison/managers/content_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _init_get_data(self):

# Load images for preview window. Multi thread for faster reading.
file_paths = file_utils.complete_paths(self.root, self.preview_folder, self.files)
metadata = self.metadata[self.preview_folder] if self.require_color_conversion else repeat(None)
metadata = self.metadata[self.preview_folder] if self.require_color_conversion else [None] * len(file_paths)

return_values = tqdm(
iterable=self.executor.map(self._init_load_file_info, file_paths, metadata),
Expand Down Expand Up @@ -120,11 +120,10 @@ def _get_current_paths(self) -> List[str]:
return output_paths

def _get_current_metadata(self) -> List[dict]:
if not self.require_color_conversion:
return repeat(None)
metadata = []
for method in self.current_methods:
metadata.append(self.current_metadata[method][self.current_index])
value = None if not self.require_color_conversion else self.current_metadata[method][self.current_index]
metadata.append(value)
return metadata

def set_current_files(self, indices: List[int]):
Expand Down

0 comments on commit 1cddf9e

Please sign in to comment.