Skip to content

Commit

Permalink
Merge pull request #273 from DropSnorz/fix/ignore-hfs-files
Browse files Browse the repository at this point in the history
fix(#271): exclude hfs files from plugin and project discovery
  • Loading branch information
DropSnorz authored Nov 19, 2024
2 parents 67ada30 + 11f3114 commit de1cc4c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -59,7 +60,12 @@ public List<PluginFile> collect(String directoryPath, PluginFormat pluginFormat)
PluginFileFormatResolver pluginFileResolver = new PluginFileFormatResolver(runtimePlatform, pluginFormat);
baseFiles.sort(Comparator.comparing(File::getAbsolutePath));

for (File file : baseFiles) {
List<File> filteredFiles = baseFiles.stream()
// Filter out HFS metadata files starting with "._"
.filter(file -> !file.getName().startsWith("._"))
.toList();

for (File file : filteredFiles) {
/*
* Lookup for nested plugins in bundles and prevent them from being referenced multiple times.
* For example a VST3 bundle file can contain a .vst3 file for windows, but we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected TaskResult call() throws Exception {

projectDAO.deleteAll();


// Collect files from all project directories
List<File> baseFiles = new ArrayList<>();
for (String directory : projectDirectories) {
File dir = new File(directory);
Expand All @@ -64,9 +64,15 @@ protected TaskResult call() throws Exception {
}
}

this.setMaxProgress(baseFiles.size());
// Filter collected files
List<File> filteredFiles = baseFiles.stream()
// Filter out HFS metadata files starting with "._"
.filter(file -> !file.getName().startsWith("._"))
.toList();

this.setMaxProgress(filteredFiles.size());

for (File file : baseFiles) {
for (File file : filteredFiles) {
this.commitProgress(1);
AbletonProjectExplorer abletonExplorer = new AbletonProjectExplorer();
ReaperProjectExplorer reaperExplorer = new ReaperProjectExplorer();
Expand Down

0 comments on commit de1cc4c

Please sign in to comment.