Updated docs to reflect that we actually have a working WebUI now. and fix outdated concepts and incorrect information as of now.
This commit is contained in:
277
FAQ.md
277
FAQ.md
@@ -22,20 +22,47 @@ It will show you the relevant information regarding the command and some frequen
|
||||
### How to turn on scheduled tasks for import/export?
|
||||
|
||||
Scheduled tasks are configured via specific environment variables refers
|
||||
to [environment variables](#environment-variables) section, to turn on the import/export tasks add the following
|
||||
environment variables:
|
||||
to [environment variables](#environment-variables) section,
|
||||
|
||||
* `WS_CRON_IMPORT=1`
|
||||
* `WS_CRON_EXPORT=1`
|
||||
#### Via WebUI
|
||||
|
||||
Simply go to `Tasks` page and enable the tasks you want to run.
|
||||
|
||||
#### Via CLI
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console system:env -k WS_CRON_IMPORT -e true
|
||||
$ docker exec -ti watchstate console system:env -k WS_CRON_EXPORT -e true
|
||||
```
|
||||
|
||||
By default, `import` is scheduled to run every `1hour` while `export` is scheduled to run every `1hour 30minutes`, you
|
||||
can alter the time when the tasks are run via adding the following variables with valid cron expression. good source to
|
||||
check your cron expression is [crontab.guru](https://crontab.guru/).
|
||||
|
||||
* `WS_CRON_IMPORT_AT="*/1 * * * *"`
|
||||
* `WS_CRON_EXPORT_AT="30 */1 * * *"`
|
||||
While we think they are reasonable defaults, you can change them by setting the following environment variables:
|
||||
|
||||
to see the status of your scheduled tasks, simply run the following command:
|
||||
#### Via WebUI
|
||||
|
||||
Go to the `env` page, click on `+` button, then select the key in this case `WS_CRON_IMPORT_AT`, `WS_CRON_EXPORT_AT`
|
||||
and set the value to a valid cron expression. Then click save to apply the new timer. This will be change later to be included with
|
||||
the tasks page.
|
||||
|
||||
#### Via CLI
|
||||
|
||||
Execute the following commands:
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console system:env -k WS_CRON_IMPORT_AT -e '"*/1 * * * *"'
|
||||
$ docker exec -ti watchstate console system:env -k WS_CRON_EXPORT_AT -e '"30 */1 * * *"'
|
||||
```
|
||||
|
||||
For Values with space, they must be enclosed in double quotes. to see the status of your scheduled tasks,
|
||||
|
||||
#### Via WebUI
|
||||
|
||||
Go to the `Tasks` page, you will see the status of each task.
|
||||
|
||||
#### Via CLI
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console system:tasks
|
||||
@@ -68,7 +95,8 @@ Use the ids as parameters for `user:` in this case it should be `user:"1000:1000
|
||||
|
||||
### How to find the apikey?
|
||||
|
||||
Run the following command:
|
||||
You can find the apikey inside the following file `/config/config/.env`. The apikey is stored inside this variable `WS_API_KEY=`.
|
||||
Or you can run the following command to get it directly:
|
||||
|
||||
```bash
|
||||
$ docker exec -ti console system:apikey
|
||||
@@ -79,11 +107,10 @@ $ docker exec -ti console system:apikey
|
||||
### What the API key used for?
|
||||
|
||||
The API key is used to authenticate the requests to the tool, it's used to prevent unauthorized access. The API key is
|
||||
required for all endpoints except the `/v1/api/[backend_name]/webhook` endpoint which is open by default Unless you have
|
||||
enabled `WS_SECURE_API_ENDPOINTS` environment variable. which then you also need to use the apikey for it.
|
||||
required for all endpoints except the `/v1/api/[backend_name]/webhook` endpoint which is open by default unless you have
|
||||
enabled `WS_SECURE_API_ENDPOINTS` environment variable. which then you also need to use the apikey for it webhook endpoint.
|
||||
|
||||
The new `WebUI` will also require the API key to access data as it's decoupled from the backend and run in standalone
|
||||
mode.
|
||||
The new `WebUI` will also require the API key to access data as it's decoupled from the backend and run in standalone mode.
|
||||
|
||||
----
|
||||
|
||||
@@ -105,13 +132,14 @@ $ docker exec -ti console state:export -fi -s [BACKEND_NAME]
|
||||
|
||||
This likely due to the new backend reporting newer date than your old backend. as such the typical setup is to
|
||||
prioritize items with newer date compared to old ones. This is what you want to happen normally. However, if the new
|
||||
media backend state is not correct this might override your current watch state.
|
||||
media backend state is not correct this might override your current watch state. The solution to get both in sync, and to do so follow these steps:
|
||||
|
||||
The solution to get both in sync, and to do so follow these steps:
|
||||
Add your backend that has correct watch state and enable full import. Second, add your new backend as metadata source.
|
||||
|
||||
1. Add your backend that has correct watch state and enable full import.
|
||||
2. Add your new backend as metadata source only, when adding a backend you will get
|
||||
asked `Enable importing of metadata and play state from this backend?` answer with `N` for the new backend.
|
||||
In `CLI` context Answer `N` to the question `Enable importing of metadata and play state from this backend?`. Make sure to select yes
|
||||
for export to get the option to select the backend as metadata source.
|
||||
|
||||
In `WebUI` if you disable import, you will get an extra option that is normally hidden to select the backend as metadata source.
|
||||
|
||||
After that, do single backend export by using the following command:
|
||||
|
||||
@@ -120,8 +148,15 @@ $ docker exec -ti watchstate console state:export -vvif -s new_backend_name
|
||||
```
|
||||
|
||||
Running this command will force full export your current database state to the selected backend. Once that done you can
|
||||
turn on import from the new backend. by editing the backend setting
|
||||
via `docker exec -ti watchstate console config:manage -s backend_name`
|
||||
turn on import from the new backend.
|
||||
|
||||
In `CLI` context you can enable import by running the following command:
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console config:manage -s backend_name
|
||||
```
|
||||
|
||||
In `WebUI` you can enable import by going to the `backends` page and click on import for the new backend.
|
||||
|
||||
----
|
||||
|
||||
@@ -158,8 +193,7 @@ database state back to the selected backend.
|
||||
### Is there support for Multi-user setup?
|
||||
|
||||
No, The tool is designed to work for single user. However, It's possible to run container for each user. You can also
|
||||
use single container for all users, however it's not really easy refer
|
||||
to [issue #136](https://github.com/arabcoders/watchstate/issues/136).
|
||||
use single container for all users, however it's not really easy refer to [issue #136](https://github.com/arabcoders/watchstate/issues/136).
|
||||
|
||||
For `Jellyfin` and `Emby`, you can just generate new API tokens and link it to a user.
|
||||
|
||||
@@ -179,36 +213,33 @@ $ docker exec -ti console backend:users:list -s backend_name --with-tokens
|
||||
### How do i migrate invited friends i.e. (external user) data from from plex to emby/jellyfin?
|
||||
|
||||
As this tool is designed to work with single user, You have to treat each invited friend as a separate user. what is
|
||||
needed, you need to contact that friend of yours and ask him to give you a copy of
|
||||
his [X-Plex-Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/),
|
||||
needed, you need to contact that friend of yours and ask him/her to give you a copy of the [X-Plex-Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/),
|
||||
then create new container and add the backend with the token you got from your friend.
|
||||
|
||||
After that, add your other backends like emby/jellyfin using your regular API key. jellyfin/emby differentiate between
|
||||
users by using the userId which
|
||||
you should select at the start of the add process.
|
||||
users by using the userId which you should select at the start of the add process.
|
||||
|
||||
After that. run the `state:import -f -s [plex_server_name]` command to import the user watch state. After that, you can
|
||||
run the `state:export -fi -s [emby/jellyfin_server_name]` to export the
|
||||
watch state to the new backend.
|
||||
run the `state:export -fi -s [emby/jellyfin_server_name]` to export the watch state to the new backend.
|
||||
|
||||
You have to repeat these steps for each user you want to migrate their data off the plex server.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> YOU MUST always start with fresh data for **EACH USER**, otherwise unexpected things might happen.
|
||||
> Make sure to delete compose.yaml `./data` directory. to start fresh
|
||||
> Make sure to delete compose.yaml `./data` directory. to start fresh.
|
||||
|
||||
----
|
||||
|
||||
### Does this tool require webhooks to work?
|
||||
|
||||
No, You can use the `task scheduler` or on `demand sync` if you want.
|
||||
No, You can use the `task scheduler` or on `on demand sync` if you want.
|
||||
|
||||
---
|
||||
|
||||
### I get tired of writing the whole command everytime is there an easy way run the commands?
|
||||
|
||||
Since there is no way to access the command interface outside the container, you can create small shell script to at
|
||||
least omit part of command that you have to write for example, to create shortcut for docker command do the following:
|
||||
Good News, There is a way to make your life easier, We recently added a `WebUI` which should cover most of the use cases.
|
||||
However, if you still want to use the `CLI` You can create a shell script to omit the `docker exec -ti watchstate console`
|
||||
|
||||
```bash
|
||||
$ echo 'docker exec -ti watchstate console "$@"' > ws
|
||||
@@ -227,8 +258,7 @@ Sometimes there are problems related to HTTP/2, so before reporting bug please t
|
||||
$ docker exec -ti watchstate console config:edit --key options.client.http_version --set 1.0 -s backend_name
|
||||
```
|
||||
|
||||
This will force set the internal http client to use http v1 if it does not fix your problem, please open bug report
|
||||
about it.
|
||||
This will force set the internal http client to use `http/v1` if it does not fix your problem, please open bug report about it.
|
||||
|
||||
---
|
||||
|
||||
@@ -240,7 +270,7 @@ If you want to increase the timeout for specific backend you can run the followi
|
||||
$ docker exec -ti watchstate console config:edit --key options.client.timeout --set 600 -s backend_name
|
||||
```
|
||||
|
||||
where `600` is the number of secs before the timeout handler will kill the request.
|
||||
where `600` is the number of seconds before the timeout handler will kill the request.
|
||||
|
||||
---
|
||||
|
||||
@@ -268,7 +298,7 @@ $ mv /config/db/watchstate_v01-repaired.db /config/db/watchstate_v01.db
|
||||
|
||||
---
|
||||
|
||||
### Which external db ids supported for Plex Media Server?
|
||||
### Which external db ids `GUIDS` supported for Plex Media Server?
|
||||
|
||||
* tvdb://(id) `New plex agent`
|
||||
* imdb://(id) `New plex agent`
|
||||
@@ -280,11 +310,8 @@ $ mv /config/db/watchstate_v01-repaired.db /config/db/watchstate_v01.db
|
||||
* com.plexapp.agents.xbmcnfo://(id)?lang=en `(XBMC NFO Movies agent)`
|
||||
* com.plexapp.agents.xbmcnfotv://(id)?lang=en `(XBMC NFO TV agent)`
|
||||
* com.plexapp.agents.hama://(db)\d?-(id)?lang=en `(HAMA multi source db agent mainly for anime)`
|
||||
* com.plexapp.agents.ytinforeader://(id)
|
||||
?lang=en [ytinforeader.bundle](https://github.com/arabcoders/plex-ytdlp-info-reader-agent)
|
||||
With [jp_scanner.py](https://github.com/arabcoders/plex-daily-scanner) as scanner.
|
||||
* com.plexapp.agents.cmdb://(id)
|
||||
?lang=en [cmdb.bundle](https://github.com/arabcoders/cmdb.bundle) `(User custom metadata database)`.
|
||||
* com.plexapp.agents.ytinforeader://(id)?lang=en [ytinforeader.bundle](https://github.com/arabcoders/plex-ytdlp-info-reader-agent) With [jp_scanner.py](https://github.com/arabcoders/plex-daily-scanner) as scanner.
|
||||
* com.plexapp.agents.cmdb://(id)?lang=en [cmdb.bundle](https://github.com/arabcoders/cmdb.bundle) `(User custom metadata database)`.
|
||||
|
||||
---
|
||||
|
||||
@@ -296,21 +323,23 @@ $ mv /config/db/watchstate_v01-repaired.db /config/db/watchstate_v01.db
|
||||
* tvmaze://(id)
|
||||
* tvrage://(id)
|
||||
* anidb://(id)
|
||||
* ytinforeader://(
|
||||
id) [jellyfin](https://github.com/arabcoders/jf-ytdlp-info-reader-plugin) & [Emby](https://github.com/arabcoders/emby-ytdlp-info-reader-plugin). `(A yt-dlp info reader plugin)`.
|
||||
* cmdb://(
|
||||
id) [jellyfin](https://github.com/arabcoders/jf-custom-metadata-db) & [Emby](https://github.com/arabcoders/emby-custom-metadata-db). `(User custom metadata database)`.
|
||||
* ytinforeader://(id) [jellyfin](https://github.com/arabcoders/jf-ytdlp-info-reader-plugin) & [Emby](https://github.com/arabcoders/emby-ytdlp-info-reader-plugin). `(A yt-dlp info reader plugin)`.
|
||||
* cmdb://(id) [jellyfin](https://github.com/arabcoders/jf-custom-metadata-db) & [Emby](https://github.com/arabcoders/emby-custom-metadata-db). `(User custom metadata database)`.
|
||||
|
||||
---
|
||||
|
||||
### Environment Variables
|
||||
|
||||
There are many ways to load the environment variables, However the recommended methods are:
|
||||
The recommended approach is for keys that starts with `WS_` use the `WebUI > Env` page, or `system:env` command via CLI.
|
||||
For other keys that aren't directly related to the tool, you **MUST** load them via container environment or the `compose.yaml` file.
|
||||
|
||||
* Via `compose.yaml` file.
|
||||
* Via `/config/config/.env` file. This file normally does not exist you have to created manually.
|
||||
to see list of loaded environment variables
|
||||
|
||||
to see list of loaded environment variables run:
|
||||
#### Via WebUI
|
||||
|
||||
Go to `Env` page, you will see all the environment variables loaded.
|
||||
|
||||
#### Via CLI
|
||||
|
||||
```shell
|
||||
$ docker exec -ti watchstate console system:env
|
||||
@@ -318,7 +347,7 @@ $ docker exec -ti watchstate console system:env
|
||||
|
||||
#### Tool specific environment variables.
|
||||
|
||||
These environment variables relates to the tool itself, you can load them via the recommended methods.
|
||||
These environment variables relates to the tool itself, You should manage them via `WebUI > Env` page or `system:env` command via CLI.
|
||||
|
||||
| Key | Type | Description | Default |
|
||||
|-------------------------|---------|-------------------------------------------------------------------------|--------------------------|
|
||||
@@ -346,22 +375,32 @@ These environment variables relates to the tool itself, you can load them via th
|
||||
$ docker exec -ti watchstate console system:tasks
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> To see all supported tool specific environment variables
|
||||
|
||||
#### Via WebUI
|
||||
|
||||
Go to the `Env` page, click `+` button, you will get list of all supported keys with description.
|
||||
|
||||
#### Via CLI
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console system:env --list
|
||||
```
|
||||
|
||||
#### Container specific environment variables.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> These environment variables relates to the container itself, and must be added via the `compose.yaml` file.
|
||||
> These environment variables relates to the container itself, and MUST be added via container environment or by the `compose.yaml` file.
|
||||
|
||||
| Key | Type | Description | Default |
|
||||
|----------------------|---------|--------------------------------------|----------|
|
||||
| WEBUI_ENABLED | bool | Enable WebUI. Value casted to a bool | `true` |
|
||||
| DISABLE_HTTP | integer | Disable included `HTTP Server`. | `0` |
|
||||
| DISABLE_CRON | integer | Disable included `Task Scheduler`. | `0` |
|
||||
| DISABLE_CACHE | integer | Disable included `Cache Server`. | `0` |
|
||||
| HTTP_PORT | string | Change the `HTTP` listen port. | `"8080"` |
|
||||
| FPM_PORT | string | Change the `PHP-FPM` listen port. | `"9000"` |
|
||||
| ~~WS_DISABLE_HTTP~~ | integer | Deprecated use `DISABLE_HTTP` | `0` |
|
||||
| ~~WS_DISABLE_CRON~~ | integer | Deprecated use `DISABLE_CRON` | `0` |
|
||||
| ~~WS_DISABLE_CACHE~~ | integer | Deprecated use `DISABLE_CACHE` | `0` |
|
||||
| Key | Type | Description | Default |
|
||||
|---------------|---------|--------------------------------------|----------|
|
||||
| WEBUI_ENABLED | bool | Enable WebUI. Value casted to a bool | `true` |
|
||||
| DISABLE_HTTP | integer | Disable included `HTTP Server`. | `0` |
|
||||
| DISABLE_CRON | integer | Disable included `Task Scheduler`. | `0` |
|
||||
| DISABLE_CACHE | integer | Disable included `Cache Server`. | `0` |
|
||||
| HTTP_PORT | string | Change the `HTTP` listen port. | `"8080"` |
|
||||
| FPM_PORT | string | Change the `PHP-FPM` listen port. | `"9000"` |
|
||||
|
||||
---
|
||||
|
||||
@@ -369,7 +408,7 @@ $ docker exec -ti watchstate console system:tasks
|
||||
|
||||
The Webhook URL is backend specific, the request path is `/v1/api/backend/[BACKEND_NAME]/webhook`,
|
||||
Where `[BACKEND_NAME]` is the name of the backend you want to add webhook for. Typically, the full URL
|
||||
is `http://localhost:8080/v1/api/backend/[BACKEND_NAME]/webhook`.
|
||||
is `http://localhost:8080/v1/api/backend/[BACKEND_NAME]/webhook`. Or simply go to the `WebUI > Backends` and click on `Copy Webhook URL`.
|
||||
|
||||
> [!NOTE]
|
||||
> You will keep seeing the `webhook.token` key, it's being kept for backward compatibility, and will be removed in the
|
||||
@@ -483,7 +522,7 @@ Click `Save`
|
||||
|
||||
### What are the webhook limitations?
|
||||
|
||||
Those are some web hook limitations we discovered for the following media backends.
|
||||
Those are some webhook limitations we discovered for the following media backends.
|
||||
|
||||
#### Plex
|
||||
|
||||
@@ -494,8 +533,7 @@ Those are some web hook limitations we discovered for the following media backen
|
||||
#### Emby
|
||||
|
||||
* Emby does not send webhooks events for newly added items.
|
||||
~~[See feature request](https://emby.media/community/index.php?/topic/97889-new-content-notification-webhook/)~~
|
||||
implemented in `4.7.9` still does not work as expected no metadata being sent when the item notification goes out.
|
||||
~~[See feature request](https://emby.media/community/index.php?/topic/97889-new-content-notification-webhook/)~~ implemented in `4.7.9` still does not work as expected no metadata being sent when the item notification goes out.
|
||||
* Emby webhook test event does not contain data. To test if your setup works, play something or do mark an item as
|
||||
played or unplayed you should see changes reflected in `docker exec -ti watchstate console db:list`.
|
||||
|
||||
@@ -521,11 +559,10 @@ command.
|
||||
|
||||
### How to disable the included HTTP server and use external server?
|
||||
|
||||
Set this environment variable in your `compose.yaml` file `WS_DISABLE_HTTP` with value of `1`. your external
|
||||
server need to send correct fastcgi environment variables. Example caddy file
|
||||
Set this environment variable in your `compose.yaml` file `DISABLE_HTTP` with value of `1`. your external
|
||||
server need to send correct fastcgi environment variables. Example caddy file:
|
||||
|
||||
```caddyfile
|
||||
|
||||
https://watchstate.example.org {
|
||||
# Change "172.23.1.2" to your watchstate container ip e.g. "172.23.20.20"
|
||||
reverse_proxy 172.23.1.2:9000 {
|
||||
@@ -540,15 +577,17 @@ https://watchstate.example.org {
|
||||
}
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
> If you change the FastCGI Process Manager TCP port via FPM_PORT environment variable, you should change the port in the caddy file as well.
|
||||
|
||||
---
|
||||
|
||||
### How to disable the included cache server and use external cache server?
|
||||
|
||||
Set this environment variable in your `compose.yaml` file `WS_DISABLE_CACHE` with value of `1`.
|
||||
to use external redis server you need to alter the value of `WS_CACHE_URL` environment variable. the format for this
|
||||
variable is `redis://host:port?password=auth&db=db_num`, for example to use redis from another container you could use
|
||||
something like `redis://172.23.1.10:6379?password=my_secert_password&db=8`. We only support `redis` and API compatible
|
||||
alternative.
|
||||
Set this environment variable in your `compose.yaml` file `DISABLE_CACHE` with value of `1`. to use external redis server
|
||||
you need to alter the value of `WS_CACHE_URL` environment variable. the format for this variable is `redis://host:port?password=auth&db=db_num`,
|
||||
for example to use redis from another container you could use something like `redis://172.23.1.10:6379?password=my_secert_password&db=8`.
|
||||
We only support `redis` and API compatible alternative.
|
||||
|
||||
Once that done, restart the container.
|
||||
|
||||
@@ -557,13 +596,12 @@ Once that done, restart the container.
|
||||
### How to get WatchState working with YouTube content/library?
|
||||
|
||||
Due to the nature on how people name their youtube files i had to pick something specific for it to work cross supported
|
||||
media agents. Please visit [this link](https://github.com/arabcoders/jf-ytdlp-info-reader-plugin#usage) to know how to
|
||||
name your files. Please be aware these plugins and scanners `REQUIRE`
|
||||
that you have a `yt-dlp` `.info.json` files named exactly as your media file. For example, if you
|
||||
have `20231030 my awesome youtube video [youtube-RandomString].mkv`
|
||||
you should have `20231030 my awesome youtube video [youtube-RandomString].info.json` in the same directory. In the
|
||||
future, I plan to make `.info.json` optional However at the moment the file is required for emby/jellyfin plugin to
|
||||
work.
|
||||
media agents. Please visit [this link](https://github.com/arabcoders/jf-ytdlp-info-reader-plugin#usage) to know how to name your files. Please be aware these plugins and scanners `REQUIRE`
|
||||
that you have a `yt-dlp` `.info.json` files named exactly as your media file.
|
||||
|
||||
For example, if you have `20231030 my awesome youtube video [youtube-RandomString].mkv`you should
|
||||
have `20231030 my awesome youtube video [youtube-RandomString].info.json` in the same directory. In the future,
|
||||
I plan to make `.info.json` optional However at the moment the file is required for emby/jellyfin plugin to work.
|
||||
|
||||
#### Plex Setup
|
||||
|
||||
@@ -573,13 +611,11 @@ work.
|
||||
|
||||
#### Jellyfin Setup
|
||||
|
||||
* Download this plugin [jf-ytdlp-info-reader-plugin](https://github.com/arabcoders/jf-ytdlp-info-reader-plugin). Please
|
||||
refer to the link on how to install it.
|
||||
* Download this plugin [jf-ytdlp-info-reader-plugin](https://github.com/arabcoders/jf-ytdlp-info-reader-plugin). Please refer to the link on how to install it.
|
||||
|
||||
#### Emby Setup
|
||||
|
||||
* Download this plugin [emby-ytdlp-info-reader-plugin](https://github.com/arabcoders/emby-ytdlp-info-reader-plugin).
|
||||
Please refer to the link on how to install it.
|
||||
* Download this plugin [emby-ytdlp-info-reader-plugin](https://github.com/arabcoders/emby-ytdlp-info-reader-plugin). Please refer to the link on how to install it.
|
||||
|
||||
If your media is not matching correctly or not marking it as expected, it's most likely scanners issues as plex and
|
||||
jellyfin/emby reports the GUID differently, and we try our best to match them. So, please hop on discord with the
|
||||
@@ -589,7 +625,7 @@ relevant data if they are not matching correctly, and we hopefully can resolve i
|
||||
|
||||
### How to check if the container able to communicate with the media backends?
|
||||
|
||||
If you having problem adding a backend to `WatchState`, it most likely network related problem, Where the container
|
||||
If you having problem adding a backend to `WatchState`, it most likely network related problem, where the container
|
||||
isn't able to communicate with the media backend. Thus, you will get errors. To make sure the container is able to
|
||||
communicate with the media backend, you can run the following command and check the output.
|
||||
|
||||
@@ -632,9 +668,8 @@ If everything is working correctly you should see something like this previous j
|
||||
|
||||
### I keep receiving this warning in log `INFO: Ignoring [xxx] Episode range, and treating it as single episode. Backend says it covers [00-00]`?
|
||||
|
||||
We recently added guard clause to prevent backends from sending possibly invalid episode ranges, as such if you see
|
||||
this,
|
||||
this likely means your backend mis-identified episodes range. By default, we allow an episode to cover up to 4 episodes.
|
||||
We recently added guard clause to prevent backends from sending possibly invalid episode ranges, as such if you see this,
|
||||
this likely means your backend mis-identified episodes range. By default, we allow an episode to cover up to `3` episodes.
|
||||
|
||||
If this is not enough for your library content. fear not we have you covered you can increase the limit by running the
|
||||
following command:
|
||||
@@ -646,28 +681,23 @@ $ docker exec -ti watchstate console config:edit --key options.MAX_EPISODE_RANGE
|
||||
where `10` is the new limit. You can set it to any number you want. However, Please do inspect the reported records as
|
||||
it most likely you have incorrect metadata in your library.
|
||||
|
||||
In the future, we plan to reduce the log level to `DEBUG` instead of `INFO`. However, for now, we will keep it as is.
|
||||
to inform you about the issue.
|
||||
|
||||
---
|
||||
|
||||
### I Keep receiving [jellyfin] item [id: name] is marked as [played] vs local state [unplayed], However due to the remote item date [date] being older than the last backend sync date [date]. it was not considered as valid state.
|
||||
|
||||
Sadly, this is due to bug in jellyfin, where it marks the item as played without updating the LastPlayedDate, and as
|
||||
such, watchstate doesn't really know the item has changed since last sync.
|
||||
Unfortunately, there is no way to fix this issue from our side for the `state:import` task as it working as intended.
|
||||
such, watchstate doesn't really know the item has changed since last sync. Unfortunately, there is no way to fix this
|
||||
issue from our side for the `state:import` task as it working as intended.
|
||||
|
||||
However, we managed to somewhat implement a workaround for this issue using the webhooks feature as temporary fix. Until
|
||||
jellyfin devs fixes the issue. Please take look at
|
||||
the webhooks section to enable it.
|
||||
jellyfin devs fixes the issue. Please take look at the webhooks section to enable it.
|
||||
|
||||
---
|
||||
|
||||
### Bare metal installation
|
||||
|
||||
We officially only support the docker container, however for the brave souls who want to install the tool directly on
|
||||
their server,
|
||||
You can follow these steps.
|
||||
their server, You can follow these steps.
|
||||
|
||||
#### Requirements
|
||||
|
||||
@@ -678,31 +708,62 @@ You can follow these steps.
|
||||
with [php-redis](https://github.com/phpredis/phpredis).
|
||||
* [Caddy](https://caddyserver.com/) for frontend handling. However, you can use whatever you like. As long as it has
|
||||
support for fastcgi.
|
||||
* [nodejs v20+](https://nodejs.org/en/download/) for `WebUI` compilation.
|
||||
|
||||
#### Installation
|
||||
|
||||
1. Clone the repository.
|
||||
* Clone the repository.
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/arabcoders/watchstate.git
|
||||
```
|
||||
|
||||
2. Install the dependencies.
|
||||
* Install the dependencies.
|
||||
|
||||
```bash
|
||||
$ cd watchstate
|
||||
$ composer install --no-dev
|
||||
```
|
||||
|
||||
3. Create `.env` inside `./var/config/` if you need to change any of the environment variables refer
|
||||
to [Tool specific environment variables](#tool-specific-environment-variables) for more information. For example,
|
||||
if your `redis` server is not on the same server or requires a password you can add the following to the `.env` file.
|
||||
* If you your redis server on external server, run the following command
|
||||
|
||||
```dotenv
|
||||
WS_CACHE_URL="redis://127.0.0.1:6379?password=your_password"
|
||||
```bash
|
||||
$ ./bin/console system:env -k WS_CACHE_URL -e '"redis://127.0.0.1:6379?password=your_password"'
|
||||
```
|
||||
|
||||
4. link the app to the frontend proxy. For caddy, you can use the following configuration.
|
||||
Change the connection string to match your redis server.
|
||||
|
||||
* Compile the `WebUI`.
|
||||
|
||||
First you need to install `yarn` as it's our package manager of choice.
|
||||
|
||||
```bash
|
||||
$ npm -g install yarn
|
||||
```
|
||||
|
||||
Once that is done you are ready to compile the `WebUI`.
|
||||
|
||||
```bash
|
||||
$ cd frontend
|
||||
$ yarn install --production --prefer-offline --frozen-lockfile
|
||||
```
|
||||
|
||||
There should be a new directory called `exported`, you need to move that folder to the `public` directory.
|
||||
|
||||
```bash
|
||||
$ mv exported ../public
|
||||
```
|
||||
|
||||
If you do `ls ../public` you should see the following contents
|
||||
|
||||
```bash
|
||||
ws:/opt/app/public$ ls
|
||||
exported index.php
|
||||
```
|
||||
|
||||
There must be exactly one `index.php` file and one `exported` directory. inside that directory.
|
||||
|
||||
* link the app to the frontend proxy. For caddy, you can use the following configuration.
|
||||
|
||||
> [!NOTE]
|
||||
> frontend server is only needed for `webhooks` and the upcoming `API` & `Web UI`.
|
||||
@@ -717,13 +778,13 @@ http://watchstate.example.org {
|
||||
}
|
||||
```
|
||||
|
||||
5. To access the console you can run the following command.
|
||||
* To access the console you can run the following command.
|
||||
|
||||
```bash
|
||||
$ /home/[user]/watchstate/bin/console help
|
||||
$ ./bin/console help
|
||||
```
|
||||
|
||||
6. To make the tasks scheduler work you need to add the following to your crontab.
|
||||
* To make the tasks scheduler work you need to add the following to your crontab.
|
||||
|
||||
```crontab
|
||||
* * * * * /home/[user]/watchstate/bin/console system:tasks --run --save-log
|
||||
|
||||
49
README.md
49
README.md
@@ -53,10 +53,6 @@ services:
|
||||
user: "${UID:-1000}:${GID:-1000}"
|
||||
container_name: watchstate
|
||||
restart: unless-stopped
|
||||
# For information about supported environment variables visit FAQ page.
|
||||
# works for both global and container specific environment variables.
|
||||
environment:
|
||||
- WS_TZ=UTC # Set timezone.
|
||||
ports:
|
||||
- "8080:8080" # The port which will serve WebUI + API + Webhooks
|
||||
volumes:
|
||||
@@ -165,18 +161,18 @@ $ docker exec -ti watchstate console state:import -v -s home_plex -s home_jellyf
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Now that you have imported your current play state enable the import task by adding the following environment
|
||||
> variables to
|
||||
> your `compose.yaml` file `WS_CRON_IMPORT=1`. By default, we have it disabled. for more environment variables
|
||||
> please
|
||||
> refer to [Environment variables list](FAQ.md#environment-variables).
|
||||
> Now that you have imported your current play state enable the import task by using the following command
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console system:env -k WS_CRON_IMPORT -e true
|
||||
```
|
||||
|
||||
### Supported import methods
|
||||
|
||||
Out of the box, we support the following import methods:
|
||||
|
||||
* Scheduled Task. `Cron jobs that pull data from backends on a schedule.`
|
||||
* On demand. `Pull data from backends on demand. By running the state:import & state:export command manually`
|
||||
* Scheduled Tasks. `Cron jobs that pull data from backends on a schedule.`
|
||||
* On demand. `Pull data from backends on demand. By running the state:import command manually`
|
||||
* Webhooks. `Receive events from backends and update the database accordingly.`
|
||||
|
||||
> [!NOTE]
|
||||
@@ -189,9 +185,8 @@ Out of the box, we support the following import methods:
|
||||
|
||||
What does `export` or what does the command `state:export` means in context of watchstate?
|
||||
|
||||
Export means, sending data back to backends, while trying to minimize the network traffic.
|
||||
|
||||
To export your current play state to backends that have export enabled, run the following command
|
||||
Export means, sending data back to backends, while trying to minimize the network traffic. To export your current play
|
||||
state to backends that have export enabled, run the following command:
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console state:export -v
|
||||
@@ -205,11 +200,11 @@ $ docker exec -ti watchstate console state:export -v -s home_plex -s home_jellyf
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Now that you have exported your current play state, enable the export task by adding the following environment
|
||||
> variables to
|
||||
> your `compose.yaml` file `WS_CRON_EXPORT=1`. By default, we have it disabled. for more environment variables
|
||||
> please
|
||||
> refer to [Environment variables list](FAQ.md#environment-variables).
|
||||
> Now that you have exported your current play state, enable the export task by using the following command
|
||||
|
||||
```bash
|
||||
$ docker exec -ti watchstate console system:env -k WS_CRON_EXPORT -e true
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -218,14 +213,16 @@ $ docker exec -ti watchstate console state:export -v -s home_plex -s home_jellyf
|
||||
Take look at this [frequently asked questions](FAQ.md) page. to know more about this tool and how to enable webhook
|
||||
support and answers to many questions.
|
||||
|
||||
# Social contact
|
||||
---
|
||||
|
||||
If you have short or quick questions, you are free to join my [discord server](https://discord.gg/haUXHJyj6Y) and ask
|
||||
the question. keep in mind it's solo project, as such it might take me a bit of time to reply.
|
||||
# Social channels
|
||||
|
||||
If you have short or quick questions, or just want to chat with other users, feel free to join my [discord server](https://discord.gg/haUXHJyj6Y).
|
||||
keep in mind it's solo project, as such it might take me a bit of time to reply to questions.
|
||||
|
||||
---
|
||||
|
||||
# Donate
|
||||
|
||||
If you feel like donating and appreciate my work, you can do so by donating to children charity. For
|
||||
example [Make-A-Wish](https://worldwish.org).
|
||||
I Personally don't need the money, but I do appreciate the gesture. Making a child happy is the best thing you can do in
|
||||
this world.
|
||||
If you feel like donating and appreciate my work, you can do so by donating to children charity. For example [Make-A-Wish](https://worldwish.org).
|
||||
I Personally don't need the money, but I do appreciate the gesture.
|
||||
|
||||
@@ -710,7 +710,7 @@ class Import
|
||||
$episodeRangeLimit = (int)ag($context->options, Options::MAX_EPISODE_RANGE, 3);
|
||||
$range = range(ag($entity, 'IndexNumber'), $indexNumberEnd);
|
||||
if (count($range) > $episodeRangeLimit) {
|
||||
$this->logger->info(
|
||||
$this->logger->warning(
|
||||
'Ignoring [{backend}] [{library.title}] [{segment.number}/{segment.of}] [{item.type}: {item.title}] Episode range, and treating it as single episode. Backend says it covers [{item.indexNumber}-{item.indexNumberEnd}] [{item.rangeCount}].',
|
||||
[
|
||||
'backend' => $context->backendName,
|
||||
|
||||
Reference in New Issue
Block a user