Skip to content

Commit

Permalink
Removes Fx and Instrument from tags as it is already covered by the n…
Browse files Browse the repository at this point in the history
…ode its category
  • Loading branch information
azeno committed Dec 11, 2024
1 parent 0a16c55 commit e071f3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deployment/VL.Audio.VST.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>VL.Audio.VST</id>
<version>0.0.12-alpha</version>
<version>0.0.13-alpha</version>
<title>VL.Audio.VST</title>
<authors>vvvv</authors>
<projectUrl>https://github.com/vvvv/VL.Audio.VST</projectUrl>
Expand Down
19 changes: 14 additions & 5 deletions src/Internal/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,22 @@ ImmutableArray<IVLNodeDescription> GetNodes(IVLNodeDescriptionFactory f, IEnumer
IVLNodeDescription GetNodeDescription(IVLNodeDescriptionFactory nodeDescriptionFactory, string modulePath, ClassInfo info)
{
const string mainCategory = "Audio.VST";
const string effectCategoryName = "Effect";
const string instrumentCategoryName = "Instrument";

var subCategory =
info.SubCategories.Contains("Fx", StringComparer.OrdinalIgnoreCase) ? "Effect" :
info.SubCategories.Contains("Instrument", StringComparer.OrdinalIgnoreCase) ? "Instrument" :
"Other";

var subCategory = "Other";
var tags = info.SubCategories;
if (info.SubCategories.Contains("Fx", StringComparer.OrdinalIgnoreCase))
{
subCategory = effectCategoryName;
tags = tags.Remove("Fx", StringComparer.OrdinalIgnoreCase);
}
else if (info.SubCategories.Contains("Instrument", StringComparer.OrdinalIgnoreCase))
{
subCategory = instrumentCategoryName;
tags = tags.Remove("Instrument", StringComparer.OrdinalIgnoreCase);
}

if (!string.IsNullOrEmpty(info.Vendor) && !tags.Contains(info.Vendor))
tags = tags.Add(info.Vendor);

Expand Down

0 comments on commit e071f3f

Please sign in to comment.