Skip to content

Add MyAnimePulse anime tracker provider#3926

Open
LLAbdul wants to merge 27 commits into
MALSync:masterfrom
LLAbdul:feat/myanimepulse-tracker
Open

Add MyAnimePulse anime tracker provider#3926
LLAbdul wants to merge 27 commits into
MALSync:masterfrom
LLAbdul:feat/myanimepulse-tracker

Conversation

@LLAbdul
Copy link
Copy Markdown

@LLAbdul LLAbdul commented May 27, 2026

Adds MyAnimePulse (https://myanimepulse.com) as an anime tracker provider.
MyAnimePulse is a MAL-ID-based anime tracking site, so entries map directly
to the existing MAL id used across MAL-Sync.

Disclosure: I maintain MyAnimePulse. Happy to adjust anything to match
project conventions. Contact: Discord llabdul.

Scope

  • Anime sync only for now. MyAnimePulse also has manga lists; manga sync is
    not implemented yet and is planned as a follow-up.
  • Full single sync: status, episode, score, start/finish dates, rewatch count.
  • List view, search (for the correction UI), and metadata overview.

Auth

Token-based. The user signs in on myanimepulse.com/auth/extension, which hands
the extension a scoped token via postMessage; the token is stored in settings
and sent as a Bearer header. Mirrors the credential-capture pattern of the
existing OAuth providers (shared handler in src/_provider/MyAnimePulse/oauth.ts,
content script in src/index-webextension/myanimepulseOauth.ts).

Provider files

src/_provider/MyAnimePulse/ — single, list, search, metaOverview, helper, oauth.

Integration points

  • src/provider/templates.ts — provider entry + shortName.
  • src/utils/syncHandler.ts — URL detection, sync dispatch, rewatch check.
  • src/pages/pageInterface.ts + src/chibiScript/functions/core/coreFunctions.ts
    — provider unions.
  • src/index.ts + src/index-webextension/myanimepulseOauth.ts — userscript +
    webextension OAuth registration.
  • webpackConfig/httpPermissions.json — myanimepulse.com host permission.

Testing

Verified end-to-end against live streaming pages: episode/status sync from a
watching page, read-back on revisit, start/finish date auto-fill, and rewatch
count. Built and loaded as an unpacked webextension. No automated tests added
(consistent with the existing providers).

LLAbdul added 23 commits May 27, 2026 17:54
The login/token flow worked but progress never synced. Four fixes:

- _update reads /anime-list/{id} (path) instead of the collection route
  /anime-list?animeId=, which ignores the param and returns an array, so
  the single-entry { entry } was never seen.
- Set _onList from the read; SingleAbstract only flips it true after a
  successful sync, so listed anime previously showed as not-on-list.
- _sync uses POST /anime-list (an upsert) instead of PATCH. PATCH on a
  missing row returns 500, not 404, so first-time tracking failed.
- apiCall surfaces non-2xx as real errors with the status, so a 4xx
  body is no longer mistaken for a successful response.

Read the anime metadata response unwrapped (no { data } envelope).
Renames the user-visible text only: the provider title in settings,
shortName, list name, OAuth success page, and error messages.

Internal identifiers stay as-is (ANIMEPULSE sync-mode value, the
animepulseToken storage key, the AnimePulse/ folder and import aliases).
The animepulse-token postMessage type is a wire contract shared with the
web app's /auth/extension page, so renaming it here alone would break
token capture.
Brings MyAnimePulse to parity with the built-in trackers across the
points the initial integration didn't cover:

- httpPermissions.json: grant host access to myanimepulse.com (needed
  for the background xhr that does the actual list read/write).
- provider/templates.ts: shortName for the overview/UI label.
- utils/syncHandler.ts: getType() detects myanimepulse.com, syncItem()
  dispatches to the AnimePulse single, and rewatch-count cross-sync is
  enabled (anime-only, so dates stay excluded).
- pages/pageInterface.ts + chibiScript provider() union: allow page /
  chibi scripts to resolve MYANIMEPULSE as the active provider. (The
  generated ChibiGeneratorTypes.ts picks this up on build.)
Flip datesSupport on now that the API stores start_date/finish_date (animepulse MALSync#219) and accepts rewatchCount on POST (MALSync#221). Implement the four date getters/setters as YYYY-MM-DD strings (the abstract's startFinishDate type), read them back in _update sliced from the API's ISO datetimes, and send startDate/finishDate/rewatchCount in the _sync POST. Also makes _getRating async to satisfy the abstract's Promise<string> contract.
Renames ANIMEPULSE_INTEGRATION.md -> MYANIMEPULSE_INTEGRATION.md and replaces the stale pre-build plan with accurate present-tense docs: real auth flow (/auth/extension token), POST upsert (not the planned PATCH), the actual integration points (templates/syncHandler/pageInterface/coreFunctions/oauth/httpPermissions, not the singleFactory/pulse-id plan), and the endpoints/status map as shipped.
Renames src/_provider/AnimePulse -> MyAnimePulse and updates all 7 path imports plus the class aliases (AnimePulseSingle/List, animePulseSearch -> MyAnimePulse*), matching the MyAnimePulse brand used everywhere else. Internal keys left intentionally: the animepulseToken setting and the webpack 'animepulse' page-url key are renaming-neutral (changing the setting key would invalidate stored tokens and force re-auth). tsc clean, webextension builds.
Copilot AI review requested due to automatic review settings May 27, 2026 21:56
LLAbdul added 4 commits May 27, 2026 18:06
Drop self-evident narration (the page-size check, the empty no-op setters' notes) and trim two wordy comments to the why. Remaining comments explain only non-obvious decisions: POST-not-PATCH upsert, the path-vs-collection route gotcha, the ISO->YYYY-MM-DD conversion, and the _onList read semantics.
translateList fell through to PLAN_TO_WATCH for status.Rewatching (23) since MyAnimePulse's enum has no rewatching value, so starting a rewatch wrongly demoted a Completed entry to Plan-to-Watch. Map an in-progress rewatch to Watching; the rewatch count still increments on finish.
MyAnimePulse stores an in-progress rewatch as WATCHING + is_rewatching=true (animepulse MALSync#226). Map status.Rewatching to/from the flag: _setStatus records it, _getStatus returns Rewatching when set, _update reads it, _sync sends it. Replaces the lossy Rewatching->Watching collapse so the site can badge active rewatches; the count still bumps on finish.
SingleAbstract.increaseRewatchCount() is a no-op stub providers must override (MAL/AniList/Kitsu do). Ours didn't, so finishRewatchingMessage() flipped status back to Completed but never bumped rewatchCount. Override it to persist the +1.
@lolamtisch
Copy link
Copy Markdown
Member

I'm sorry, but the project seems very early in development. Just mirroring MAL/AniList is a very slippery slope legally. they have non-competition clauses on the data. In the current state, I don't see that it brings much new to the table, especially as you don't give any service guarantees.

Do you plan anything special in the future? Without a clear unique value and addressing the legal concerns, makes it difficult for me to merge this.

@LLAbdul
Copy link
Copy Markdown
Author

LLAbdul commented May 28, 2026

I'm sorry, but the project seems very early in development. Just mirroring MAL/AniList is a very slippery slope legally. they have non-competition clauses on the data. In the current state, I don't see that it brings much new to the table, especially as you don't give any service guarantees.

Do you plan anything special in the future? Without a clear unique value and addressing the legal concerns, makes it difficult for me to merge this.

Yeah, that's fair. The data side is the real problem and I'm not gonna pretend it isn't. All good, and thanks for actually taking the time to look at it. I'm around on Discord if you ever want to chat.

@lolamtisch lolamtisch added the out of scope Diverges from the main purpose of the project label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

out of scope Diverges from the main purpose of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants