Watch
1
0
Fork
You've already forked asbplayer-fork
0
forked from keir/asbplayer

feat(jimaku): allow configuring the Jimaku API URL #1

Open
keir wants to merge 1 commit from feat/jimaku-configurable-api-url into main
Owner

Closes keir/asbplayer#1

Summary

Adds a Jimaku API URL field to the online subtitle search dialog so the Jimaku endpoint is no longer hard-coded to https://jimaku.cc/api. This makes it possible to point asbplayer at a self-hosted Jimaku instance, a caching reverse proxy (to stay under the API rate limit), or a network workaround.

Changes

  • common/subtitle-sources/subtitle-sources.ts: export defaultJimakuBaseUrl, add normalizeJimakuBaseUrl/isValidJimakuBaseUrl — empty falls back to https://jimaku.cc/api, trailing slashes are stripped, and anything else must be a well-formed http(s) URL. JimakuClient now normalizes its baseUrl option at construction.
  • common/global-state/index.ts: new jimakuBaseUrl?: string on OnlineSubtitleSourceConfig, persisted alongside the other Jimaku settings (empty = default).
  • common/components/OnlineSubtitleSourceDialog.tsx: new Jimaku API URL field below the API key (with inline validation and default shown as placeholder); the configured URL is passed to JimakuClient.
  • common/components/VideoDataSyncDialog.tsx: wires the new setting through.
  • Locales: jimakuBaseUrl, jimakuBaseUrlHint, jimakuBaseUrlInvalid added to all 13 locale files (loc-keys-match passes; ja translated, other locales use English fallback text).
  • Docs: new "Custom API URL" section in docs/docs/guides/online-subtitles.md, including a note that a custom host must allow CORS.
  • Tests: base URL validation at construction, empty → public API fallback, custom base URL with trailing slash normalization.

Testing

pnpm run verify passes (loc key checks, typecheck, common/client/extension tests, eslint, scripts tests, prettier).

Notes

  • This PR lives on keir/asbplayer-fork because keir/asbplayer is a read-only mirror that auto-pulls from github.com/asbplayer/asbplayer — Forgejo hard-codes that mirrors can never accept pull requests (Repository.CanEnablePulls() returns false for mirrors), so the change is reviewed here instead. The fork's main matches the mirror's main at time of forking.
  • To land the change upstream, the branch can be pushed to github.com:asbplayer/asbplayer as a PR there.
  • Commit includes the Assisted-by tag per CONTRIBUTING.md.
Closes keir/asbplayer#1 ### Summary Adds a **Jimaku API URL** field to the online subtitle search dialog so the Jimaku endpoint is no longer hard-coded to `https://jimaku.cc/api`. This makes it possible to point asbplayer at a self-hosted [Jimaku](https://github.com/Rapptz/jimaku) instance, a caching reverse proxy (to stay under the API rate limit), or a network workaround. ### Changes - `common/subtitle-sources/subtitle-sources.ts`: export `defaultJimakuBaseUrl`, add `normalizeJimakuBaseUrl`/`isValidJimakuBaseUrl` — empty falls back to `https://jimaku.cc/api`, trailing slashes are stripped, and anything else must be a well-formed http(s) URL. `JimakuClient` now normalizes its `baseUrl` option at construction. - `common/global-state/index.ts`: new `jimakuBaseUrl?: string` on `OnlineSubtitleSourceConfig`, persisted alongside the other Jimaku settings (empty = default). - `common/components/OnlineSubtitleSourceDialog.tsx`: new **Jimaku API URL** field below the API key (with inline validation and default shown as placeholder); the configured URL is passed to `JimakuClient`. - `common/components/VideoDataSyncDialog.tsx`: wires the new setting through. - Locales: `jimakuBaseUrl`, `jimakuBaseUrlHint`, `jimakuBaseUrlInvalid` added to all 13 locale files (`loc-keys-match` passes; ja translated, other locales use English fallback text). - Docs: new "Custom API URL" section in `docs/docs/guides/online-subtitles.md`, including a note that a custom host must allow CORS. - Tests: base URL validation at construction, empty → public API fallback, custom base URL with trailing slash normalization. ### Testing `pnpm run verify` passes (loc key checks, typecheck, common/client/extension tests, eslint, scripts tests, prettier). ### Notes - This PR lives on `keir/asbplayer-fork` because `keir/asbplayer` is a read-only mirror that auto-pulls from `github.com/asbplayer/asbplayer` — Forgejo hard-codes that mirrors can never accept pull requests (`Repository.CanEnablePulls()` returns `false` for mirrors), so the change is reviewed here instead. The fork's `main` matches the mirror's `main` at time of forking. - To land the change upstream, the branch can be pushed to `github.com:asbplayer/asbplayer` as a PR there. - Commit includes the `Assisted-by` tag per CONTRIBUTING.md.
The online subtitle search dialog now has a "Jimaku API URL" field
alongside the API key, stored in onlineSubtitleSourceConfig and passed
through to JimakuClient. An empty value falls back to
https://jimaku.cc/api, values are validated as http(s) URLs, and
trailing slashes are stripped so custom base paths resolve consistently.

Makes it possible to point asbplayer at a self-hosted Jimaku instance,
a caching proxy, or a network workaround instead of the hard-coded
public API.

Closes #1

Assisted-by: pi:xiaomi/mimo-v2.6-pro
keir changed title from probe same-repo to feat(jimaku): allow configuring the Jimaku API URL 2026-10-18 22:22:14 +01:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/jimaku-configurable-api-url:feat/jimaku-configurable-api-url
git switch feat/jimaku-configurable-api-url

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/jimaku-configurable-api-url
git switch feat/jimaku-configurable-api-url
git rebase main
git switch main
git merge --ff-only feat/jimaku-configurable-api-url
git switch feat/jimaku-configurable-api-url
git rebase main
git switch main
git merge --no-ff feat/jimaku-configurable-api-url
git switch main
git merge --squash feat/jimaku-configurable-api-url
git switch main
git merge --ff-only feat/jimaku-configurable-api-url
git switch main
git merge feat/jimaku-configurable-api-url
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
keir/asbplayer-fork!1
No description provided.