Skip to content
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

[Plugin] Sync reading history #137

Closed
LancerComet opened this issue Apr 9, 2024 · 4 comments
Closed

[Plugin] Sync reading history #137

LancerComet opened this issue Apr 9, 2024 · 4 comments
Assignees
Labels
feature New feature is needed

Comments

@LancerComet
Copy link
Member

Rulia will invoke "addReadHistory" function that provides by plugin to add reading history to target site.

@LancerComet LancerComet added the feature New feature is needed label Apr 9, 2024
@LancerComet LancerComet self-assigned this Apr 9, 2024
@LancerComet
Copy link
Member Author

@LancerComet
Copy link
Member Author

LancerComet commented Apr 9, 2024

Now plugin can define a function named addReadHistory in plugin code:

/**
 *  Add reading history to the target server.
 *
 *  @param {string} url The manga chapter url that the Rulia requests to.
 */
async function addReadHistory (url: string) {
  // Get necessary information from the url.
  // For an example, the url is "https://www.my-manga-site.com/chapter/12450"
  const chapterId = getChapterIdFromUrl(url)  // 12450
  await fetch('https://www.my-manga-site.com/reading-history/add', { ... })
}

Rulia invokes this function when every chapter opens.

@LancerComet
Copy link
Member Author

Done

@LancerComet
Copy link
Member Author

Available since 0.18.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature is needed
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant