Skip to content

Commit

Permalink
fix: backslashes in f-string error on file drop dupe widget (#289)
Browse files Browse the repository at this point in the history
* fix: python complaining about backslashes inside f-string expressions
refactor excessively long f-string into separate variables

* fix: missing f on f-string

* Format with Ruff
  • Loading branch information
Technoguyfication committed Jun 14, 2024
1 parent e5a0e5a commit 888b674
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tagstudio/src/qt/modals/drop_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,15 @@ def duplicates_choice(self) -> int:
if len(self.duplicate_files) > display_limit:
dupes_to_show = dupes_to_show[0:display_limit]

dupes_str = "\n ".join(map(lambda path: str(path), dupes_to_show))
dupes_more = (
f"\nand {len(self.duplicate_files)-display_limit} more "
if len(self.duplicate_files) > display_limit
else "\n"
)

msgBox.setText(
f"The following files:\n {'\n '.join(map(lambda path: str(path),self.get_relative_paths(dupes_to_show)))} {(f'\nand {len(self.duplicate_files)-display_limit} more ') if len(self.duplicate_files)>display_limit else '\n'}have filenames that already exist in the library folder."
f"The following files:\n {dupes_str}{dupes_more}have filenames that already exist in the library folder."
)
msgBox.addButton("Skip", QMessageBox.ButtonRole.YesRole)
msgBox.addButton("Override", QMessageBox.ButtonRole.DestructiveRole)
Expand Down

0 comments on commit 888b674

Please sign in to comment.