aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_indexer.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-24 20:31:04 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-24 20:31:04 +0200
commit6c56877675958e40ae526e0965266ab68aae44f2 (patch)
treefaa097bfeb0a20614481ffd071fb2470c2f4eb91 /packages/meshbay-node/tests/test_indexer.py
parented97f138cfc0aee5ac04e4d12b9e392277cbcc40 (diff)
downloadmeshbay-6c56877675958e40ae526e0965266ab68aae44f2.tar.gz
feat(node): recognize WMA and Musepack as audio, read their real tag keys
A real-library scan turned up 250 .wma and 23 .mpc files that the indexer was silently classifying as "other" — genuinely lost from the Music app, not a consolidation-rule artifact (checked separately: the grouping logic itself drops nothing). Both are now indexed as audio and tagged properly: - WMA has no mutagen "easy" wrapper, so the generic tag reader was reading nothing from it at all. Reads the real ASF keys directly instead (Title/Author/WM-AlbumTitle/WM-TrackNumber), confirmed against a real sample file before writing the mapping. - Musepack's format auto-detection is unreliable enough (misidentified a real .mpc as MP3 in spot checks) that it now always opens by its own class instead of guessing from content. - Filters out another placeholder value found along the way: a French ripping tool's auto-generated "Album inconnu (<timestamp>)". Neither format decodes natively in a browser's <audio> element, so this gets them correctly visible, tagged, and covered — not yet playable in-browser. That would need server-side transcoding, deliberately left out of this change.
Diffstat (limited to 'packages/meshbay-node/tests/test_indexer.py')
-rw-r--r--packages/meshbay-node/tests/test_indexer.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/meshbay-node/tests/test_indexer.py b/packages/meshbay-node/tests/test_indexer.py
index 3eac39e..56571a4 100644
--- a/packages/meshbay-node/tests/test_indexer.py
+++ b/packages/meshbay-node/tests/test_indexer.py
@@ -146,6 +146,17 @@ async def test_type_detection(shared_dir, sk_node, gek):
assert by_name["manual.pdf"] == "document"
+def test_type_detection_covers_wma_and_musepack():
+ """
+ Both formats are real audio a real library can contain, even though
+ neither one plays natively in a browser <audio> element — that gap is
+ a separate, later concern (transcoding); being correctly typed and
+ tagged is not the same thing as being playable.
+ """
+ assert indexer_mod._detect_type(Path("track.wma")) == "audio"
+ assert indexer_mod._detect_type(Path("track.mpc")) == "audio"
+
+
@pytest.mark.asyncio
async def test_hidden_files_excluded(tmp_path, sk_node, gek):
d = tmp_path / "dir"