diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-09-03 18:31:31 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-09-03 18:31:31 +0200 |
| commit | baa0c4b2fca251bb6267b71ed9c7f1142e7992d6 (patch) | |
| tree | a85e9c74ad949503b9fbac28576c6e18fcc4c3f0 /load_spreadsheet.js | |
| parent | f2c4d48523a8a6d541289e2d4c57a65eeb9f5af0 (diff) | |
add 3d stuff and other stuff
Diffstat (limited to 'load_spreadsheet.js')
| -rw-r--r-- | load_spreadsheet.js | 22 |
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 = [ { |
