diff options
author | metamuffin <metamuffin@disroot.org> | 2024-03-23 01:27:11 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-03-23 01:27:11 +0100 |
commit | 4fefaf44b094aeac30028bc7199992bb5e6d4b3c (patch) | |
tree | 2667f258f1d09a9c04b30b44e2e82bc9688e0b11 | |
parent | 1d38bd821351324b51a15a9400630c49d9838f80 (diff) | |
download | jellything-4fefaf44b094aeac30028bc7199992bb5e6d4b3c.tar jellything-4fefaf44b094aeac30028bc7199992bb5e6d4b3c.tar.bz2 jellything-4fefaf44b094aeac30028bc7199992bb5e6d4b3c.tar.zst |
doc rust api
-rw-r--r-- | doc/api.md | 46 | ||||
-rw-r--r-- | doc/import/providers.md | 2 |
2 files changed, 38 insertions, 10 deletions
@@ -1,9 +1,28 @@ -# Jellything API +# Jellything Rust API + +For making your own applications that implement client functionality, use the +`jellyclient` crate. The `jellycommon` crate exposes commonly used structs like +those used in the library and for jhls. + +## Generated Documentation + +- [jellything](/doc/jellything/) +- [jellycommon](/doc/jellycommon/) +- [jellyremuxer](/doc/jellyremuxer/) +- [jellytranscode](/doc/jellytranscode/) +- [jellyimport](/doc/jellyimport/) +- [jellymatroska](/doc/jellymatroska/) + - [ebml_derive](/doc/ebml_derive/) +- [jellybase](/doc/jellybase/) +- [jellystream](/doc/jellystream/) +- [jellytool](/doc/jellytool/) + +# Jellything HTTP API Most endpoints require the `Accept` header to be present and set to -`application/json` and `image/avif` respectively. Any endpoint returning JSON, will report errors with an -object containing error string in the `error` key. Routes marked with `*` -require authentification. +`application/json` and `image/avif` respectively. Any endpoint returning JSON, +will report errors with an object containing error string in the `error` key. +Routes marked with `*` require authentification. The `jellyclient` crate already implements most API functionality. The `jellycommon` crate provides useful structs for deserializing data (also @@ -18,38 +37,47 @@ jellyclient = { git = "https://codeberg.org/metamuffin/jellything.git" } ## General ### GET `/api/version` + Returns API version number. ### POST `/api/create_session` + Request body contains JSON with keys `username`, `password`, `expire` (in seconds) and `drop_permissions` (a list of permissions, that this session cannot use). The Response contains the session cookie as a string in JSON. ### GET* `/n/<id>` + Request a library node (either a directory or item). Returns it as `NodePublic`. ### GET* `/n/<id>/extended` + Request extended informationf for library node. Returns it as `ExtendedNode`. ## Assets All asset endpoints redirect to the asset that you need. Returned images are -coded with AVIF. The `width` parameter is the width of the resolution you want to image to be. +coded with AVIF. The `width` parameter is the width of the resolution you want +to image to be. -> [!WARNING] -> The actual returned resolution must not be exactly what you requested. +> [!WARNING] The actual returned resolution must not be exactly what you +> requested. ### GET* `/n/<id>/asset?<role>&<width>` -Where `role` is one of `backdrop` or `poster` and + +Where `role` is one of `backdrop` or `poster` and ### GET* `/n/<id>/thumbnail?<t>&<width>` -Returns a single frame from some track video of the media at a given time `t`. + +Returns a single frame from some track video of the media at a given time `t`. ### GET* `/n/<id>/person/<index>/asset?<group>&<width>` + Returns headshot of a person from that node. ## Stream ### GET* `/stream/<id>?<format>&<index>&<profile>&<index>&<tracks>&<webm>` + Responds with the stream directly or a redirect to the actual source in case of federation. diff --git a/doc/import/providers.md b/doc/import/providers.md index 9b438c6..dcb9bfd 100644 --- a/doc/import/providers.md +++ b/doc/import/providers.md @@ -2,7 +2,7 @@ ## `override` -Allows for manual hardcoded metadata. +Allows for manual hardcoded metadata. This an instance of [`Node`](/doc/jellycommon/struct.Node.html). Special to this option are the `poster` and `backdrop` properties in the `private` section. These are reference images local to _library\_path_ and |