Separate audio discovery into TTS STT music and voice categories

This commit is contained in:
Mikei386
2026-09-28 23:28:33 +02:00
parent 9fecb30a8f
commit 52b1116bdb
9 changed files with 21 additions and 7 deletions
+6
View File
@@ -91,6 +91,12 @@ class CatalogTests(unittest.TestCase):
with tempfile.TemporaryDirectory() as d:
c=Catalog(d);c.pending=[('sentinel',)];c.stop(shutdown=True)
with patch('catalog.threading.Thread') as thread:c._next();thread.assert_not_called()
def test_audio_categories_use_separate_tasks(self):
from urllib.parse import urlsplit,parse_qs
with tempfile.TemporaryDirectory() as d,patch('catalog.metadata',return_value=[]) as fetch:
for kind,task in [('audio','text-to-speech'),('stt','automatic-speech-recognition'),('music','text-to-audio'),('voice','audio-to-audio')]:
Catalog(d).search('',kind)
self.assertEqual(parse_qs(urlsplit(fetch.call_args.args[0]).query)['filter'],[task])
def test_cancellation(self):
with tempfile.TemporaryDirectory() as directory:
c=Catalog(directory);c.job=dict(state='downloading');c.stop()