hello tw-community!
i’m trying to:
- import a folder structure with files (currently testing with 23,9 GiB
2 123 files, 135 sub-folders) - mainly pictures audios videos pdfs located inside subdirectories used for tagging and topic-structuring (i create a .tid file for each directory as folder-reference) - reference those external media files using either _canonical_uri for pictures or custom field “src” for embedding files so the wiki doesn’t get too big over time…
with the help of tiddlywiki.files…
it works fine with “folders” (.tid reference) and images, eg:
{
"directories": [
{
"path": "../../../../files/",
"filesRegExp": "^.*\\.(?:jpg|jpeg|png|gif)$",
"isTiddlerFile": false,
"isEditableFile": true,
"searchSubdirectories": true,
"fields": {
"title": {"source": "basename-uri-decoded"},
"created": {"source": "created"},
"modified": {"source": "modified"},
"type": "image/jpeg",
"tags": {"source": "lowestofsubdirectories"},
"text": "",
"_canonical_uri": { "source": "filepath", "prefix": "files/" }
}
},
{
"path": "../../../../files/",
"filesRegExp": "^.*\\.(?:tid)$",
"isTiddlerFile": false,
"isEditableFile": true,
"searchSubdirectories": true,
"fields": {
"title": {"source": "basename-uri-decoded"},
"created": {"source": "created"},
"modified": {"source": "modified"},
"tags": {"source": "lowestofsubdirectories"},
"parent": {"source": "lowestofsubdirectories"}
}
}
]
}
but once i add mp4 files to the mix:
{
"path": "../../../../files/",
"filesRegExp": "^.*\\.(?:mp4)$",
"isTiddlerFile": false,
"isEditableFile": false,
"searchSubdirectories": true,
"fields": {
"title": {"source": "filename"},
"tags": {"source": "lowestofsubdirectories"},
"text": "",
"src": { "source": "filepath", "prefix": "files/" }
}
},
i get the error message when trying to run on node:
sudo node ./tiddlywiki.js Wikis/RootWiki --wsserver <!--bob plugin - same issue with --listen --> 1 ✘ 14s
node:buffer:685
slice: (buf, start, end) => buf.base64Slice(start, end),
^
**Error: Cannot create a string longer than 0x1fffffe8 characters**
at Object.slice (node:buffer:685:37)
at Buffer.toString (node:buffer:864:14)
at Object.readFileSync (node:fs:491:41)
at processFile ($:/boot/boot.js:1980:14)
at $:/boot/boot.js:2087:7
at $tw.utils.each ($:/boot/boot.js:146:12)
at $tw.loadTiddlersFromSpecification ($:/boot/boot.js:2069:12)
at $tw.loadTiddlersFromPath ($:/boot/boot.js:1950:45)
at $:/boot/boot.js:1955:40
at $tw.utils.each ($:/boot/boot.js:146:12) {
code: 'ERR_STRING_TOO_LONG'
}
Node.js v23.9.0
any suggestions? help appreciated