Skip to content

Director and Jukebox Plus Update#2090

Merged
Alicekb merged 17 commits intoRoll20:masterfrom
keithcurtis1:master
Jul 22, 2025
Merged

Director and Jukebox Plus Update#2090
Alicekb merged 17 commits intoRoll20:masterfrom
keithcurtis1:master

Conversation

@keithcurtis1
Copy link
Copy Markdown
Contributor

Director, new script to run Theater of the Mind style games
Jukebox Plus update: Added Min/Max intervals to Mix mode, bug and display fixes, and simple Director integration

Copy link
Copy Markdown

@aikepah aikepah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some unused code, but seems fine in general. Found one issue with unescaped double quotes when put in your template literals that prevents users from being able to add handouts or characters when there's a double quote in the name.

Comment thread Director/Director.js
const tracks = findObjs({ _type: 'jukeboxtrack' }).sort((a, b) => a.get('title').localeCompare(b.get('title')));

const buildOpts = (objs, labelFn = o => o.get('name')) =>
objs.map(o => `${labelFn(o)},${o.id}`).join('|');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the object's name contains a double quote, ie: Thomas "Tommy" Boy it will cause the button's href to terminate early. If we escape or replace the " with " here in buildOpts it should avoid this issue.

Suggested change
objs.map(o => `${labelFn(o)},${o.id}`).join('|');
objs.map(o => `${labelFn(o).replace(/"/g, """)},${o.id}`).join('|');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll make those changes. I wasn't too concerned about breaking characters in names, because those even break vanilla macros half the time. I usually suggest to people not to include "control characters" in character and token names for that reason:
"':/(){}[], etc.

And, yeah, there was a lot of iteration on this, and it could use a cleanup sweep for abandoned code. Good catch.

@Alicekb Alicekb merged commit 70597e3 into Roll20:master Jul 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants