jellyfin-archive / jellyfin-apiclient-javascript Goto Github PK
View Code? Open in Web Editor NEWJavascript API Client for Jellyfin
Home Page: https://jellyfin.org
License: MIT License
Javascript API Client for Jellyfin
Home Page: https://jellyfin.org
License: MIT License
This is just a reminder that we need to checkup on the ramifications of removing the WanAddress from PublicSystemInfo.
The WanAddress is used in https://github.com/jellyfin/jellyfin-apiclient-javascript/blob/master/src/connectionmanager.js#L66 despite being removed from the response in jellyfin/jellyfin#1770
This line did not exist in the version of the apiclient that jf-web uses, so it was assumed not to be in use.
It probably relates to falling back to a remote connection if a local connection could not be established.
Have this error when trying to import apiclient
Code:
import apiclient from "jellyfin-apiclient";
console.log(apiclient("some url"))
Only jellyfin-apiclient module is installed from npm
Installing from source yield the same thing
Node v16.13.2
npm v8.8.0
It would be nice to have a style standard. https://github.com/jellyfin/jellyfin-web/blob/master/.eslintrc.yml could be copied as a starting point.
Https://github.com/jellyfin/jellyfin-react-client
I want to contribute code in this project, but there is no interface documentation. The trick is that I only use javascript, so it is very difficult for me to determine the interface information by looking at the server code.
I exported a swagger json file myself and imported it into swaggerUI, but the interface parameters and return values are rarely described.
https://app.swaggerhub.com/apis/vdts/jellyfin-server_api/1.0.0
If you have a slightly detailed document, there may be more front-end developers willing to join
Jellyfin recently switched to /jellyfin/
url prefix from /emby/
. This library still uses /emby/
and hence fetch requests fails.
The client fetches http://localhost:8096/emby/System/Info/Public
and the response is 302 Found
to index.html
instead of expected json.
HTTP/1.1 302 Found
Content-Length: 0
Date: Sun, 15 Dec 2019 06:57:29 GMT
Location: /jellyfin/web/index.html
Server: Kestrel
The client should fetch http://localhost:8096/jellyfin/System/Info/Public
Response:
HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json; charset=utf-8
Date: Sun, 15 Dec 2019 06:57:38 GMT
Expires: 0
Server: Microsoft-NetCore/2.0, UPnP/1.0 DLNADOC/1.50
Transfer-Encoding: chunked
Vary: Accept-Encoding
{
"Id": "0b9a3884f83e4a28a515d5565ada5d50",
"OperatingSystem": "Linux",
"ProductName": "Jellyfin Server",
"ServerName": "blackbox",
"Version": "10.4.3"
}
https://github.com/jellyfin/jellyfin-apiclient-javascript/blob/a0143bcd7dc8389c51bcb5cabebcbd1d13e31d49/src/apiClient.js#L298
This should say Reconnect succeeded
or Reconnect success
Trying to play around with a few things and because of no detailed documentation I'm just going off JSDoc and https://github.com/jellyfin/jellyfin-react-client and have stumbled on an issue.
In the connection file you are calling getApiClient().getPublicSystemInfo()
, this returns a promise that won't fulfill if the connection fails.
If the server url is correct and the web api returns the requested data the promise is resolved and fulfilled no problem. Now if the server url is incorrect the console spits out;
Request failed to http://localhost:8097/emby/System/Info/Public TypeError: Failed to fetch Attempting reconnection GET http://localhost:8097/emby/System/Info/Public net::ERR_CONNECTION_REFUSED tryReconnect:
and the promise is indefinitely left in pending.
I've only tested on Windows 10, Node v12 in electron only. I have tried using the library in both my own project and also building the react client to see the issue persist in both.
The ApiClient.getItem
method makes a GET request to /Items/{itemId}
when the userId parameter is not present, which causes a 405 Method Not Allowed
response. This function is used by the web player's SyncPlay integration, which prevents SyncPlay from working.
I haven't found a GET /Items/{itemId}
endpoint, so I think this isn't an issue with Jellyfin itself but rather with the API client. Note that GET Users/{userId}/Items/{itemId}
is an endpoint that exists, and it's what gets used outside of SyncPlay.
Relevant code:
Hey,
when trying to following the README.md, I get following error:
yarn docs
yarn run v1.22.10
error [email protected]: The engine "yarn" is incompatible with this module. Expected version "YARN NO LONGER USED - use npm instead.". Got "1.22.10"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
can't find any description in docs
i guess it's a little hard to start with src code
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.