MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / discover_named_assets

Function discover_named_assets

src/framework/runtime/model.cpp:26–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25}
26
27std::vector<NamedAsset> discover_named_assets(
28 const std::filesystem::path & root,
29 const std::vector<std::string> & relative_candidates) {
30 std::unordered_map<std::string, int> stem_counts;
31 for (const auto & candidate : relative_candidates) {
32 ++stem_counts[candidate_stem_or_filename(candidate)];
33 }
34
35 std::vector<NamedAsset> assets;
36 assets.reserve(relative_candidates.size());
37 for (const auto & candidate : relative_candidates) {
38 const auto path = root / candidate;
39 if (engine::io::is_existing_file(path)) {
40 const auto base_id = candidate_stem_or_filename(candidate);
41 const auto id = stem_counts[base_id] == 1 ? base_id : normalized_candidate_key(candidate);
42 assets.push_back({id, std::filesystem::weakly_canonical(path)});
43 }
44 }
45 return assets;
46}
47
48std::vector<NamedAsset> discover_named_assets_from_package_spec(

Callers 15

discover_config_assetsFunction · 0.85
discover_weight_assetsFunction · 0.85
discover_config_assetsFunction · 0.85
discover_weight_assetsFunction · 0.85
load_seed_vc_assetsFunction · 0.85
discover_config_assetsFunction · 0.85
discover_weight_assetsFunction · 0.85
inspect_htdemucs_modelFunction · 0.85
discover_weight_assetsFunction · 0.85
discover_config_assetsFunction · 0.85
discover_weight_assetsFunction · 0.85
discover_config_assetsFunction · 0.85

Calls 4

is_existing_fileFunction · 0.85
normalized_candidate_keyFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected