Skip to content

Updated links for images in I-Note#853

Merged
angrave merged 3 commits into
stagingfrom
update-links
Dec 3, 2025
Merged

Updated links for images in I-Note#853
angrave merged 3 commits into
stagingfrom
update-links

Conversation

@avaneeshk098

Copy link
Copy Markdown
Contributor

This PR would update the links being used for images to point to the source rather than the CT website. The changes involve finding the source ID and reconstructing the source link.

JSON Metadata Propagation

  • In service.js, when an EPub is fetched, I call getMediaById and retrieve the jsonMetadata attribute that contains the id/ shared_link.url (for Box) of the Media on its source website.
  • Used to set up getters and setters in EPubData.js for the new jsonMetadata field.
  • Using this.data, I retrieve the sourceId and sourceType.

Link Reconstruction

  • When chapter.content is an image, I match the sourceType and call the appropriate function to reconstruct the link.
  • getSourceLink computes the number of seconds to offset the start time and updates the link accordingly
  • The PDF file builder had to be handled separately, but used the same pattern.

Formatting

  • Ran prettier to update the file formatting

@avaneeshk098 avaneeshk098 linked an issue Nov 18, 2025 that may be closed by this pull request
@avaneeshk098 avaneeshk098 requested a review from angrave November 18, 2025 18:57

@angrave angrave left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@angrave angrave merged commit a3b8cfa into staging Dec 3, 2025
2 checks passed
@angrave angrave deleted the update-links branch December 3, 2025 18:35
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.

iNote images and links should redirect to original source

2 participants