Skip to content

Conversation

@avaneeshk098
Copy link
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
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