Spaces:
Sleeping
Sleeping
Fix a bug with conflicted speakers in the same rename
Browse files
state.py
CHANGED
|
@@ -277,7 +277,8 @@ def on_grename_change(idx, token_display_map=None):
|
|
| 277 |
# Sync widget key as display labels
|
| 278 |
st.session_state[grkey] = [raw_to_display.get(t, t) for t in entry["speakers"]]
|
| 279 |
|
| 280 |
-
# Enforce exclusivity
|
|
|
|
| 281 |
for token in added:
|
| 282 |
for other_idx, other_entry in enumerate(st.session_state.globalRenames):
|
| 283 |
if other_idx == idx:
|
|
|
|
| 277 |
# Sync widget key as display labels
|
| 278 |
st.session_state[grkey] = [raw_to_display.get(t, t) for t in entry["speakers"]]
|
| 279 |
|
| 280 |
+
# Enforce exclusivity: a speaker can only belong to one rename entry at a time.
|
| 281 |
+
# Remove the token from any other entry before writing the new name.
|
| 282 |
for token in added:
|
| 283 |
for other_idx, other_entry in enumerate(st.session_state.globalRenames):
|
| 284 |
if other_idx == idx:
|