summaryrefslogtreecommitdiff
path: root/load_spreadsheet.js
diff options
context:
space:
mode:
Diffstat (limited to 'load_spreadsheet.js')
-rw-r--r--load_spreadsheet.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/load_spreadsheet.js b/load_spreadsheet.js
index 5f50fa5..a7f1793 100644
--- a/load_spreadsheet.js
+++ b/load_spreadsheet.js
@@ -91,12 +91,13 @@ async function loadDataStoreIndex(path) {
* Load the files from a particular exhibit from their subdirectory in data_store
*/
async function loadFiles(folder, record) {
- const path = `./data_store/${folder}/`;
+ const path = `data_store/${folder}/`;
const files = await readdir(path);
const images = (record.images = []);
let dimensions;
for (const file of files) {
if (file.match(".DS_Store")) continue;
+ if (file.match("skip-")) continue;
if (file.match(/-URL.rtf/i)) {
await loadLink(path + file, record);
} else if (file.match(/.rtf/i)) {
@@ -104,9 +105,22 @@ async function loadFiles(folder, record) {
} else if (file.match(/.txt/i)) {
console.error("+ fix text file", path + file);
} else if (file.match(/.mtl/i)) {
- console.error("+ load mtl", path + file);
+ // console.error("+ load mtl", path + file);
+ continue;
} else if (file.match(/.obj/i)) {
- console.error("+ load mtl", path + file);
+ console.error("+ load obj", path + file);
+ record.type = "video";
+ record.threeObject = {
+ path,
+ file,
+ };
+ } else if (file.match(/-thumb.mp4$/i)) {
+ record.thumbnail = {
+ uri: `assets/data_store/${folder}/${file}`,
+ type: "video",
+ width: 320,
+ height: 240,
+ };
} else if (file.match(/-thumb/i)) {
dimensions = sizeOf(path + file);
record.thumbnail = {
@@ -115,6 +129,7 @@ async function loadFiles(folder, record) {
...dimensions,
};
} else {
+ if (record.type === "video") continue;
dimensions = sizeOf(path + file);
images.push({
uri: `assets/data_store/${folder}/${file}`,
@@ -235,6 +250,7 @@ async function loadLink(path, record) {
// } else {
// console.error("No token:", uri);
// }
+ console.log(uri);
record.type = "video";
record.images = [
{