Skip to content

Commit 888b674

Browse files
fix: backslashes in f-string error on file drop dupe widget (#289)
* 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
1 parent e5a0e5a commit 888b674

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tagstudio/src/qt/modals/drop_import.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,15 @@ def duplicates_choice(self) -> int:
168168
if len(self.duplicate_files) > display_limit:
169169
dupes_to_show = dupes_to_show[0:display_limit]
170170

171+
dupes_str = "\n ".join(map(lambda path: str(path), dupes_to_show))
172+
dupes_more = (
173+
f"\nand {len(self.duplicate_files)-display_limit} more "
174+
if len(self.duplicate_files) > display_limit
175+
else "\n"
176+
)
177+
171178
msgBox.setText(
172-
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."
179+
f"The following files:\n {dupes_str}{dupes_more}have filenames that already exist in the library folder."
173180
)
174181
msgBox.addButton("Skip", QMessageBox.ButtonRole.YesRole)
175182
msgBox.addButton("Override", QMessageBox.ButtonRole.DestructiveRole)

0 commit comments

Comments
 (0)