* [#1497] WebView: Localstorage
* WebView: Transition to our own header/postData system
This is also what is recommended by most other posts, I haven't seen the
context used anywhere, and `KCEFResourceRequestHandler` seems to just
bypass a lot of CEF
* Lint
* [#1349] Stub basic cookie authentication
* [#1349] Basic login page
Also adjusts WebView header color and shadow to match WebUI. WebUI uses
a background-image gradient to change the perceived color, which was not
noticed originally.
* [#1349] Handle login post
* [#1349] Redirect to previous URL
* [#1349] Return a basic 401 for api endpoints
Instead of redirecting to a visual login page, API should just indicate
the bad state
* Use more appropriate 303 redirect
* Update server/src/main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* Update server/src/main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* Lint
* Transition to AuthMode enum with migration path
* Make basicAuthEnabled auto property, Lint
* ConfigManager: Make sure to re-parse the config after migration
* basicAuth{Username,Password} -> auth{Username,Password}
* Lint
* Update server settings backup model
* Update comment
* Minor cleanup
* Improve backup legacy settings fix
* Lint
* Simplify config value migration
---------
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* WebView: Add initial controller
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* WebView: Prepare page
* WebView: Basic HTML setup
* WebView: Improve navigation
* WebView: Refactor message class deserialization
* WebView: Refactor event message serialization
* WebView: Handle click events
* WebView: Fix events after refactor
* WebView: Fix normalizing of URLs
* WebView: HTML remove navigation buttons
* WebView: Handle more events
* WebView: Handle document change in events
* WebView: Refactor to send mutation events
* WebView: More mouse events
* WebView: Include bubbles, cancelable in event
Those seem to be important
* WebView: Attempt to support nested iframe
* WebView: Handle long titles
* WebView: Avoid setting invalid url
* WebView: Send mousemove
* WebView: Start switch to canvas-based render
* WebView: Send on every render
* WebView: Dynamic size
* WebView: Keyboard events
* WebView: Handle mouse events in CEF
This is important because JS can't click into iFrames, meaning the
previous solution doesn't work for captchas
* WebView: Cleanup
* WebView: Cleanup 2
* WebView: Document title
* WebView: Also send title on address change
* WebView: Load and flush cookies from store
* WebView: remove outdated TODOs
* Offline WebView: Load cookies from store
* Cleanup
* Add KcefCookieManager, need to figure out how to inject it
* ktLintFormat
* Fix a few cookie bugs
* Fix Webview on Windows
* Minor cleanup
* WebView: Remove /tmp image write, lint
* Remove custom cookie manager
* Multiple cookie fixes
* Minor fix
* Minor cleanup and add support for MacOS meta key
* Get enter working
* WebView HTML: Make responsive for mobile pages
* WebView: Translate touch events to mouse scroll
* WebView: Overlay an actual input to allow typing on mobile
Browsers will only show the keyboard if an input is focused. This also
removes the `tabstop` hack.
* WebView: Protect against occasional NullPointerException
* WebView: Use float for clientX/Y
* WebView: Fix ChromeAndroid being a pain
* Simplify enter fix
* NetworkHelper: Fix cache
* Improve CookieStore url matching, fix another cookie conversion issue
* Move distinctBy
* WebView: Mouse direction toggle
* Remove accidentally copied comment
---------
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* Export meta data
* Import meta data
* Add missing "opdsUseBinaryFileSize" setting to gql
* Export server settings
* Import server settings
* Streamline server config enum handling
* Use "restore amount" in backup import progress
It's possible that the cover changed, but the url is still the same.
In that case the cover never gets updated unless the downloaded/cached file gets deleted
* Fix setting initial global update delay
In case no update has run yet, and the "last automated update" defaulted to 0, the calculation always resulted in a multiple of the interval.
This resulted for e.g., interval 24, to always be scheduled at 00:00.
For e.g., interval 6, it was always one of the following times: 00:00, 06:00, 12:00, 18:00; depending on the current system time.
* Delete the existing "last automated update time"
So that the update will be triggered based on the time the server got started again after the update.
* Extract migrations into separate functions
* Cleanup migration execution logic
* Implement Android's Looper
Looper handles thread messaging. This is used by extensions when they
want to enqueue actions e.g. for sleeping while WebView does someting
* Stub WebView
* Continue stubbing ViewGroup for WebView
* Implement WebView via Playwright
* Lint
* Implement request interception
Supports Yidan
* Support WebChromeClient
For Bokugen
* Fix onPageStarted
* Make Playwright configurable
* Subscribe to config changes
* Fix exposing of functions
* Support data urls
* Looper: Fix infinite sleep
* Looper: Avoid killing the loop on exception
Just log it and continue
* Pump playwright's message queue periodically
https://playwright.dev/java/docs/multithreading#pagewaitfortimeout-vs-threadsleep
* Update server/src/main/kotlin/suwayomi/tachidesk/graphql/types/SettingsType.kt
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* Stub a KCef WebViewProvider
* Initial Kcef Webview implementation
Still buggy, on the second call it just seems to fall over
* Format, restructure to create browser on load
This is much more consistent, before we would sometimes see errors from
about:blank, which block the actual page
* Implement some small useful properties
* Move inline objects to class
* Handle requests in Kcef
* Move Playwright implementation
* Document Playwright settings, fix deprecated warnings
* Inject default user agent from NetworkHelper
* Move playwright to libs.versions.toml
* Lint
* Fix missing imports after lint
* Update server/src/main/kotlin/suwayomi/tachidesk/server/ServerSetup.kt
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* Fix default user agent set/get
Use System.getProperty instead of SystemProperties.get
* Configurable WebView provider implementation
* Simplify Playwright settings init
* Minor cleanup and improvements
* Remove playwright WebView impl
* Document WebView for Linux
---------
Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
* feat(opds): implement full internationalization and refactor feed generation
This commit introduces a comprehensive internationalization (i18n) framework
and significantly refactors the OPDS v1.2 implementation for improved
robustness, spec compliance, and localization.
Key changes:
Internationalization (`i18n`):
- Introduces `LocalizationService` to manage translations:
- Loads localized strings from JSON files (e.g., `en.json`, `es.json`)
stored in a new `i18n` data directory.
- Default `en.json` and `es.json` files are bundled and copied from
resources on first run if not present.
- Supports template resolution with `$t()` cross-references, locale
fallbacks (to "en" by default), and argument interpolation ({{placeholder}}).
- `ServerSetup` now initializes the `i18n` directory and `LocalizationService`.
OPDS Refactor & Enhancements:
- Replaces the previous `Opds.kt` and `OpdsDataClass.kt` with a new
`OpdsFeedBuilder.kt` and a set of more granular, spec-aligned XML
models (e.g., `OpdsFeedXml`, `OpdsEntryXml`, `OpdsLinkXml`).
- Integrates `LocalizationService` throughout all OPDS feeds:
- All user-facing text (feed titles, entry titles, summaries,
link titles, facet labels for sorting/filtering) is now localized.
- Adds a `lang` query parameter to all OPDS endpoints to allow
clients to request a specific UI language.
- Uses the `Accept-Language` header as a fallback for language detection.
- The OpenSearch description (`/search` endpoint) is now localized and
its template URL includes the determined language.
- Centralizes OPDS constants (namespaces, link relations, media types)
in `OpdsConstants.kt`.
- Adds utility classes `OpdsDateUtil.kt`, `OpdsStringUtil.kt`, and
`OpdsXmlUtil.kt` for common OPDS tasks.
- `MangaDataClass` now includes `sourceLang` to provide the content
language of the manga in OPDS entries (`<dc:language>`).
- Updates OpenAPI documentation for OPDS endpoints with more detail
and includes the new `lang` parameter.
Configuration:
- Adds `useBinaryFileSizes` server configuration option. File sizes in
OPDS feeds now respect this setting (e.g., MiB vs MB), utilized via
`OpdsStringUtil.formatFileSizeForOpds`.
This major refactor addresses the request for internationalization
originally mentioned in PR #1257 ("it would be great if messages were
adapted based on the user's language settings"). It builds upon the
foundational OPDS work in #1257 and subsequent enhancements in #1262,
#1263, #1278, and #1392, providing a more stable and extensible
OPDS implementation. Features like localized facet titles from #1392
are now fully integrated with the i18n system.
This resolves long-standing requests for better OPDS support (e.g., issue #769)
by making feeds more user-friendly, accessible, and standards-compliant,
also improving the robustness of features requested in #1390 (resolved by #1392)
and addressing underlying data needs for issues like #1265 (related to #1277, #1278).
* fix(opds): revert MIME type to application/xml for browser compatibility
* fix(opds): use chapter index for metadata feed and correct link relation
- Change `getChapterMetadataFeed` to use `chapterIndexFromPath` (sourceOrder)
instead of `chapterIdFromPath` for fetching chapter data, ensuring
consistency with how chapters are identified in manga feeds.
- Add error handling for cases where manga or chapter by index is not found.
- Correct OPDS link relation for chapter detail/fetch link in non-metadata
chapter entries from `alternate` to `subsection` as per OPDS spec
for navigation to more specific content or views.
* Use Moko-Resources
* Format
* Forgot the Languages.json
* refactor(opds)!: restructure OPDS feeds and introduce data repositories
This commit significantly refactors the OPDS v1.2 implementation by introducing dedicated repository classes for data fetching and by restructuring the feed generation logic for clarity and maintainability. The `chapterId` path parameter for chapter metadata feeds has been changed to `chapterIndex` (sourceOrder) to align with how chapters are identified in manga feeds.
BREAKING CHANGE: The OPDS endpoint for chapter metadata has changed from `/api/opds/v1.2/manga/{mangaId}/chapter/{chapterId}/fetch` to `/api/opds/v1.2/manga/{mangaId}/chapter/{chapterIndex}/fetch`. Clients will need to update to use the chapter's source order (index) instead of its database ID.
Key changes:
- Introduced `MangaRepository`, `ChapterRepository`, and `NavigationRepository` to encapsulate database queries and data transformation logic for OPDS feeds.
- Moved data fetching logic from `OpdsFeedBuilder` to these new repositories.
- `OpdsFeedBuilder` now primarily focuses on constructing the XML feed structure using DTOs provided by the repositories.
- Renamed `OpdsMangaAcqEntry.thumbnailUrl` to `rawThumbnailUrl` for clarity.
- Added various DTOs (e.g., `OpdsRootNavEntry`, `OpdsMangaDetails`, `OpdsChapterListAcqEntry`) to define clear data contracts between repositories and the feed builder.
- Simplified `OpdsV1Controller` by reorganizing feed endpoints into logical groups (Main Navigation, Filtered Acquisition, Item-Specific).
- Updated `OpdsAPI` to reflect the path parameter change for chapter metadata (`chapterIndex` instead of `chapterId`).
- Added `slugify()` utility to `OpdsStringUtil` for creating URL-friendly genre IDs.
- Standardized localization keys for root feed entry descriptions to use `*.entryContent` instead of `*.description`.
- Added `server.generated.BuildConfig` (likely from build process).
* style(opds): apply ktlint fixes
* Delete server/bin
* refactor(i18n): remove custom LocalizationService initialization
* refactor(i18n): remove unused imports from ServerSetup
* refactor(model): remove sourceLang from MangaDataClass
* refactor(opds): rename OPDS binary file size config property
- Rename `useBinaryFileSizes` to `opdsUseBinaryFileSizes` in code and config
- Update related condition check in formatFileSizeForOpds
BREAKING CHANGE: Existing server configurations using `server.useBinaryFileSizes` need to migrate to `server.opdsUseBinaryFileSizes`
* refactor(opds): improve OPDS endpoint structure and documentation
- Restructure endpoint paths for better resource hierarchy
- Add descriptive comments for each feed type and purpose
- Rename `/fetch` endpoint to `/metadata` for clarity
- Standardize feed naming conventions in route definitions
BREAKING CHANGE: Existing OPDS client integrations using old endpoint paths (`/manga/{mangaId}` and `/chapter/{chapterIndex}/fetch`) require updates to new paths (`/manga/{mangaId}/chapters` and `/chapter/{chapterIndex}/metadata`)
* fix(opds): Apply review suggestions for localization and comments
* Fix
* fix(opds): Update chapter links to include 'chapters' and 'metadata' in URLs
---------
Co-authored-by: Syer10 <syer10@users.noreply.github.com>
* Improve Downloads Handling
* Update known pagecount for downloaded chapters
* Get fresh data for downloadReady
* Format
* Assume downloaded if first page is found
* Filter out ComicInfoFile
In case "ChapterForDownload#asDownloadReady" was called in quick succession, the page list got inserted twice.
This caused problems with getting the images from the rest endpoint, because they are selected by sorting them by asc index and selecting the page by using the provided index as an offset.
This, however, only works as long as there are no duplicates, otherwise, page indexes 1, 2; 3, 4; 5, 6; ... will just return the same page.
* Remove existing installations with msi installer
* Remove unused x86 wxs file
* Uninstall old msi versions with different upgrade code
* Progress but error 2721 happens on install
* Remove added uninstall previous version wxs stuff
* Use revision as patch number
MSI only uninstalls previous versions in case the version number changed (it only checks the first three numbers (major, minor, patch)).
Thus, to prevent each preview install to result in it getting registered as a new "app" and for it to uninstall the old versions, we have to change the version on each release.
* Deprecate "BuildConfig.REVISION"
* Remove outdated env vars
---------
Co-authored-by: Syer10 <syer10@users.noreply.github.com>
* Log exceptions during graphql execution
Exceptions got swallowed by graphql
* Add stack trace to error in graphql response
Depending on the exceptions error message, the error in the response might be quite useless (e.g. "Stub!" error in android classes)
The update subscription emitted the full update status, which, depending on how big the status was, took forever because the graphql subscription does not support data loader batching, causing it to run into the n+1 problem