Skip to content

Commit a2eae26

Browse files
committed
Added flag to toggle websocket connection to jellyfin via variable JF_USE_WEBSOCKETS
Updated Readme
1 parent 33f2528 commit a2eae26

2 files changed

Lines changed: 25 additions & 22 deletions

File tree

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,27 @@
2424

2525
## Environmental Variables
2626

27-
| Env | Default | Example | Description |
28-
|-------------------------------------|----------|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
29-
| POSTGRES_USER `REQUIRED` | `null` | `postgres` | Username that will be used in postgres database |
30-
| POSTGRES_PASSWORD `REQUIRED` | `null` | `postgres` | Password that will be used in postgres database |
31-
| POSTGRES_IP `REQUIRED` | `null` | `jellystat-db` or `192.168.0.5` | Hostname/IP of postgres instance |
32-
| POSTGRES_PORT `REQUIRED` | `null` | `5432` | Port Postgres is running on |
33-
| POSTGRES_SSL_ENABLED | `null` | `true` | Enable SSL connections to Postgres
34-
| POSTGRES_SSL_REJECT_UNAUTHORIZED | `null` | `false` | Verify Postgres SSL certificates when POSTGRES_SSL_ENABLED=true
35-
| JS_LISTEN_IP | `0.0.0.0`| `0.0.0.0` or `::` | Enable listening on specific IP or `::` for IPv6 |
36-
| JWT_SECRET `REQUIRED` | `null` | `my-secret-jwt-key` | JWT Key to be used to encrypt JWT tokens for authentication |
37-
| TZ `REQUIRED` | `null` | `Etc/UTC` | Server timezone (Can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |
38-
| JS_BASE_URL | `/` | `/` | Base url |
39-
| JS_USER | `null` | `User` | Master Override User in case username or password used during setup is forgotten (Both `JS_USER` and `JS_PASSWORD` required to work) |
40-
| JS_PASSWORD | `null` | `Password` | Master Override Password in case username or password used during setup is forgotten (Both `JS_USER` and `JS_PASSWORD` required to work) |
41-
| POSTGRES_DB | `jfstat` | `jfstat` | Name of postgres database |
42-
| REJECT_SELF_SIGNED_CERTIFICATES | `true` | `false` | Allow or deny self signed SSL certificates |
43-
| JS_GEOLITE_ACCOUNT_ID | `null` | `123456` | maxmind.com user id to be used for Geolocating IP Addresses (Can be found at https://www.maxmind.com/en/accounts/current/edit) |
44-
| JS_GEOLITE_LICENSE_KEY | `null` | `ASDWdaSdawe2sd186` | License key you need to generate on maxmind to use their services |
45-
| MINIMUM_SECONDS_TO_INCLUDE_PLAYBACK | `1` | `10` | The minimum time (in seconds) to include a playback record, which can be used to exclude short playbacks |
46-
| IS_EMBY_API | `false` | `true` | Set to true if using Emby instead of Jellyfin |
27+
| Env | Default | Example | Description |
28+
| ----------------------------------- | --------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
29+
| POSTGRES_USER `REQUIRED` | `null` | `postgres` | Username that will be used in postgres database |
30+
| POSTGRES_PASSWORD `REQUIRED` | `null` | `postgres` | Password that will be used in postgres database |
31+
| POSTGRES_IP `REQUIRED` | `null` | `jellystat-db` or `192.168.0.5` | Hostname/IP of postgres instance |
32+
| POSTGRES_PORT `REQUIRED` | `null` | `5432` | Port Postgres is running on |
33+
| POSTGRES_SSL_ENABLED | `null` | `true` | Enable SSL connections to Postgres |
34+
| POSTGRES_SSL_REJECT_UNAUTHORIZED | `null` | `false` | Verify Postgres SSL certificates when POSTGRES_SSL_ENABLED=true |
35+
| JS_LISTEN_IP | `0.0.0.0` | `0.0.0.0` or `::` | Enable listening on specific IP or `::` for IPv6 |
36+
| JWT_SECRET `REQUIRED` | `null` | `my-secret-jwt-key` | JWT Key to be used to encrypt JWT tokens for authentication |
37+
| TZ `REQUIRED` | `null` | `Etc/UTC` | Server timezone (Can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |
38+
| JS_BASE_URL | `/` | `/` | Base url |
39+
| JS_USER | `null` | `User` | Master Override User in case username or password used during setup is forgotten (Both `JS_USER` and `JS_PASSWORD` required to work) |
40+
| JS_PASSWORD | `null` | `Password` | Master Override Password in case username or password used during setup is forgotten (Both `JS_USER` and `JS_PASSWORD` required to work) |
41+
| POSTGRES_DB | `jfstat` | `jfstat` | Name of postgres database |
42+
| REJECT_SELF_SIGNED_CERTIFICATES | `true` | `false` | Allow or deny self signed SSL certificates |
43+
| JS_GEOLITE_ACCOUNT_ID | `null` | `123456` | maxmind.com user id to be used for Geolocating IP Addresses (Can be found at https://www.maxmind.com/en/accounts/current/edit) |
44+
| JS_GEOLITE_LICENSE_KEY | `null` | `ASDWdaSdawe2sd186` | License key you need to generate on maxmind to use their services |
45+
| MINIMUM_SECONDS_TO_INCLUDE_PLAYBACK | `1` | `10` | The minimum time (in seconds) to include a playback record, which can be used to exclude short playbacks |
46+
| IS_EMBY_API | `false` | `true` | Set to true if using Emby instead of Jellyfin |
47+
| JF_USE_WEBSOCKETS | `true` | `false` | Enables using Jellyfins websocket connection for session data (No effect on Emby) |
4748

4849
## Getting Started with Development
4950

@@ -91,4 +92,4 @@ Will set the environment variable `MYVAR` based on the contents of the `/run/sec
9192

9293
## API Documentation
9394

94-
To-do
95+
Swagger Documentation can be found at `/swagger` endpoint

backend/classes/jellyfin-api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ class JellyfinAPI {
453453
return [];
454454
}
455455
try {
456-
if (compareVersions(this.version, "10.11.0") >= 0) {
456+
if (compareVersions(this.version, "10.11.0") >= 0 &&
457+
( process.env.JF_USE_WEBSOCKETS === undefined ||
458+
process.env.JF_USE_WEBSOCKETS.toLowerCase() !== "false")) {
457459
const socketUrl =
458460
(this.config.JF_EXTERNAL_HOST ?? this.config.JF_HOST).replace(/^http/, "ws").replace(/^https/, "wss") + "/socket";
459461
const sessionData = await getSessionData(socketUrl, this.config.JF_API_KEY);

0 commit comments

Comments
 (0)