Skip to content

Commit 94481be

Browse files
committed
address PR comment
1 parent f7b6ef6 commit 94481be

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/jabs/ui/video_list_widget.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,11 @@ def _selection_changed(self, current, _):
114114
When rapidly switching videos, this cancels pending video loads and
115115
delays the selectionChanged signal emission to prevent race conditions.
116116
"""
117-
if self._suppress_selection_event:
117+
if self._suppress_selection_event or not current:
118118
return
119119

120-
# Store the pending selection
121-
if current:
122-
self._pending_selection = current.data(QtCore.Qt.ItemDataRole.UserRole)
123-
else:
124-
self._pending_selection = ""
120+
# Store the pending selection (current should always have a value due to SingleSelection mode)
121+
self._pending_selection = current.data(QtCore.Qt.ItemDataRole.UserRole)
125122

126123
# Cancel any pending timer and start a new one
127124
# This ensures only the final video in a rapid sequence gets loaded

0 commit comments

Comments
 (0)