Skip to content

fix(docs): movie example script URL build + robustness #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 8, 2025

Conversation

chhoumann
Copy link
Owner

@chhoumann chhoumann commented Aug 8, 2025

Summary

  • Avoid new URL() in example script to fix TypeError: Failed to construct 'URL': Invalid URL
  • Build URL via URLSearchParams and string concat
  • Validate OMDb API key and provide helpful message
  • Harden date parsing for Released field
  • Improve list linkification and filename sanitization

Test plan

  • Configure OMDb API key in script settings
  • Try searching by title and by IMDb ID (tt1234567)
  • Verify note fields populate, dates format as yyyy-mm-dd when possible
  • Verify generated imdbUrl is https://www.imdb.com/title/<imdbID> without quotes
  • Ensure no errors in console during usage

Scope

Docs/example script only: docs/docs/Examples/Attachments/movies.js.

Closes #629

… and missing API key

Avoid new URL() to fix Invalid URL error, validate OMDb API key, harden date parsing, list linkifying, and filename sanitization to prevent runtime crashes.
Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quickadd ✅ Ready (Inspect) Visit Preview Aug 8, 2025 5:48am

Add explicit IMDb link field using the generated imdbUrl variable.
…URL error

Clarify API key requirement and provide guidance for common errors.
Replace blockquote with Docusaurus-friendly details/summary accordion.
@chhoumann chhoumann merged commit face78e into master Aug 8, 2025
2 checks passed
@chhoumann chhoumann deleted the fix/movie-script-url branch August 8, 2025 06:03
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.

[BUG] Movie script is not working
1 participant