Ligerx / TachiWeb-React

React front end for TachiWeb-Server
10 stars 4 forks source link

Extensions #13

Closed Ligerx closed 5 years ago

Ligerx commented 6 years ago

Support for the extensions API enables users to finally take advantage of the large variety of sources Tachiyomi offers. Extensions are sources that can be downloaded from the central repository allowing users to add sources as they need them. Extension support in the TachiWeb backend should be now feature complete and currently covers:

The API to access all these features:

Extension response format: { // Extension package name "pkg_name": "eu.kanade.tachiyomi.extension.en.dynasty", // Extension name "name": "Dynasty", // Extension status. Either INSTALLED, UNTRUSTED or AVAILABLE // INSTALLED: Extension is downloaded and installed // UNTRUSTED: Extension is downloaded and installed but not trusted, the user cannot use it until it is trusted // AVAILABLE: Extension is available in the central repository and is not downloaded/installed "status": "INSTALLED", // Version name of extension "version_name": "1.2.6", // Computer-readable version code of extension "version_code": 6, // Signature hash of extension. Only present when extension status is UNTRUSTED. Used to trust the extension. "signature_hash": null, // Language of extension represented in ISO 639-1 format. Can also be set to "all" when the extension includes sources of multiple languages. "lang": "en", // A list of the IDs of all the sources included in the extension. Extensions may include multiple sources. Only present when the extension status is INSTALLED "sources": [ "738706855355689486" ], // Whether or not an update is available for this extension. Only present when the extension status is INSTALLED "has_update": false }

As far as UI goes, there are some corners you can cut. Specifically, about extension trust, just auto-trust all extensions that are uploaded. Basically, every time you see an extension with an "UNTRUSTED" status, send a request to the server to trust it immediately. Otherwise, refer to the Tachiyomi app for what the extension UI should look like. You should also provide a UI to enable/disable individual sources as the sources list can grow really fast if users install many extensions. A single extension may even include 30+ sources!

Ligerx commented 5 years ago

Completed as of acacc047c553a7976c42ad98bae4f2e664ed76f8