Fix github archive directory prefix structure logic
This commit is contained in:
@@ -30,7 +30,7 @@ public class ImportConfig {
|
||||
"https://github.com/foundryvtt/pf2e/archive/refs/heads/master.zip",
|
||||
"com.majinnaibu.monstercards.importers.Pf2eImporter",
|
||||
".json",
|
||||
"packs/pf2e"
|
||||
"pf2e-master/packs/"
|
||||
));
|
||||
|
||||
SOURCES.add(new ImportSource(
|
||||
@@ -42,7 +42,7 @@ public class ImportConfig {
|
||||
"https://github.com/foundryvtt/pf2e/archive/refs/heads/master.zip",
|
||||
"com.majinnaibu.monstercards.importers.Pf2eImporter",
|
||||
".json",
|
||||
"packs/sf2e"
|
||||
"pf2e-master/packs/sf2e"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,8 @@ public class GitRepoImporterService {
|
||||
if (isCancelled.getAsBoolean()) break;
|
||||
if (file.isFile()) {
|
||||
String content = readFileContent(file);
|
||||
if (content != null && importer.canImport(content)) {
|
||||
if (content != null) {
|
||||
if (importer.canImport(content)) {
|
||||
try {
|
||||
Monster monster = importer.parse(content);
|
||||
repository.saveMonster(monster).blockingAwait();
|
||||
@@ -154,6 +155,11 @@ public class GitRepoImporterService {
|
||||
} catch (Exception e) {
|
||||
Logger.logError("Failed to parse/save monster from file: " + file.getName(), e);
|
||||
}
|
||||
} else {
|
||||
Logger.logWTF("Importer rejected file: " + file.getName());
|
||||
}
|
||||
} else {
|
||||
Logger.logError("Failed to read content from file: " + file.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user