feat: auto-add extracted/edited clips to the library + library Edit opens the editor (v1.7)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 00:54:43 +02:00
co-authored by Claude Opus 4.8
parent f32d303d26
commit 0e82a82cde
3 changed files with 57 additions and 2 deletions
+25
View File
@@ -899,3 +899,28 @@ def test_scan_reload_selects_model_tab_not_library(win):
assert sp._tabs.currentIndex() == 1 # a model tab is selected
assert sp._current_table() is not None # regions resolve immediately
assert sp.current_model_name() == "EAT_LARGE"
def test_open_editor_adds_saved_clip_to_library(win, tmp_path, monkeypatch):
import main as m
saved = tmp_path / "edited.wav"; saved.write_bytes(b"")
class FakeDlg:
def __init__(self, path, parent=None):
self._last_saved = str(saved)
def exec(self): return 0
def deleteLater(self): pass
monkeypatch.setattr(m, "AudioEditorDialog", FakeDlg)
lib = win._scan_panel._library
lib._key = "audio_library_l3test" # throwaway, avoids polluting real settings
win._settings.setValue("audio_library_l3test", [])
lib._list.clear()
win._open_audio_editor("/x/in.wav")
assert str(saved) in lib.clips()
def test_library_edit_signal_opens_editor(win, tmp_path, monkeypatch):
import main as m
opened = []
monkeypatch.setattr(win, "_open_audio_editor", lambda p: opened.append(p))
win._scan_panel._library.edit_requested.emit("/some/clip.wav")
assert opened == ["/some/clip.wav"]