48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
#!/usr/bin/env python
|
|
"""Inventory scanner - outputs JSON of all available resources."""
|
|
import sys
|
|
import os
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
sys.stdout.reconfigure(encoding="utf-8")
|
|
|
|
from src.scanner import full_inventory
|
|
import json
|
|
|
|
|
|
def main():
|
|
inv = full_inventory()
|
|
|
|
plugins = inv["plugins"]
|
|
summary = {
|
|
"generators": plugins["generator_names"],
|
|
"effects": plugins["effect_names"],
|
|
"total_generators": len(plugins["generators"]),
|
|
"total_effects": len(plugins["effects"]),
|
|
"sample_categories": {
|
|
k: len(v) for k, v in inv["samples"]["categories"].items()
|
|
},
|
|
"total_samples": inv["samples"]["total_files"],
|
|
"packs": [
|
|
{
|
|
"name": p["name"],
|
|
"audio": len(p["contents"].get("audio", [])),
|
|
"midi": len(p["contents"].get("midi", [])),
|
|
}
|
|
for p in inv["packs"]["packs"]
|
|
],
|
|
"vector_store": {
|
|
"total": inv["vector_store"]["total"],
|
|
"types": inv["vector_store"]["types"],
|
|
},
|
|
"organized_samples": {},
|
|
}
|
|
|
|
for cat, files in inv["samples"]["categories"].items():
|
|
summary["organized_samples"][cat] = [f["name"] for f in files[:20]]
|
|
|
|
print(json.dumps(summary, indent=2, ensure_ascii=False))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|