diff --git a/FAQ.md b/FAQ.md
index 30693d39..5c56d4fc 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -402,7 +402,7 @@ command via CLI.
> [!IMPORTANT]
> for environment variables that has `{TASK}` tag, you **MUST** replace it with one
-> of `IMPORT`, `EXPORT`, `PUSH`, `BACKUP`, `PRUNE`, `INDEXES`. To see tasks active settings run
+> of `IMPORT`, `EXPORT`, `BACKUP`, `PRUNE`, `INDEXES`. To see tasks active settings run
```bash
$ docker exec -ti watchstate console system:tasks
diff --git a/NEWS.md b/NEWS.md
index a5231118..3f7cc7f0 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,45 @@
# Old Updates
+### 2024-08-10
+
+I have recently added new experimental feature, to play your content directly from the WebUI. This feature is still in
+alpha, and missing a lot of features. But it's a start. Right now it does auto transcode on the fly to play any content in the browser.
+
+The feature requires that you mount your media directories to the `WatchState` container similar to the `File integrity` feature. I have plans to expand
+the feature to support more controls, however, right now it's only support basic subtitles streams and default audio stream or first audio stream.
+
+The transcoder works by converting the media on the fly to `HLS` segments, and the subtitles are selectable via the player ui which are also converted to `vtt` format.
+
+Expects bugs and issues, as the feature is still in alpha. But I would love to hear your feedback. You can play the media by visiting
+the history page of the item you will see red play button on top right corner of the page. If the items has a play button, then you correctly mounted
+the media directories. otherwise, the button be disabled with tooltip of `Media is inaccessible`.
+
+The feature is not meant to replace your backend media player, the purpose of this feature is to quickly check the media without leaving the WebUI.
+
+### 2024-08-01
+
+We recently enabled listening on tls connections via `8443` which can be controlled by `HTTPS_PORT` environment variable.
+Before today, we simply only exposed the port via the `Dockerfile`, but we weren't listening for connections on it.
+
+However, please keep in mind that the certificate is self-signed, and you might get a warning from your browser. You can
+either accept the warning or add the certificate to your trusted certificates. We strongly recommend using a reverse proxy.
+instead of relying on self-signed certificates.
+
+### 2024-07-22
+
+We have recently added a new WebUI feature, `File integrity`, this feature will help you to check if your media backends
+are reporting files that are not available on the disk. This feature is still in alpha, and we are working on improving
+it.
+
+This feature `REQUIRES` that you mount your media directories to the `WatchState` container preferably as readonly. There is plans to add
+a path replacement feature to allow you change the pathing, but it's not implemented yet.
+
+This feature will work on both local and remote cloud storages provided they are mounted into the container. We also may recommend not to
+use this feature depending on how your cloud storage provider treats file stat calls. As it might lead to unnecessary money spending. and of course
+it will be slower.
+
+For more information about how we cache the stat calls, please refer to the [FAQ](FAQ.md#How-does-the-file-integrity-feature-works).
+
### 2024-07-06
Recently we have introduced a new feature that allows you to use Jellyfin and Emby OAuth access tokens for syncing
diff --git a/README.md b/README.md
index 66a8fa34..78496270 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,18 @@ out of the box, this tool support `Jellyfin`, `Plex` and `Emby` media servers.
## Updates
+### 2024-08-19
+
+We have migrated the `state:push` task into the new events system, as such the old task `state:push` is now gone.
+To enable the new event handler for push events, use the new environment variable `WS_PUSH_ENABLED` and set it to `true`.
+Right now, it's disabled by default. However, for people who had the old task enabled, it will reuse that setting.
+
+Keep in mind, the new event handler is more efficient and will only push data when there is a change in the play state. And it's much faster
+than the old task. This event handler will push data within a minute of the change.
+
+PS: Please enable the task by setting its new environment variable `WS_PUSH_ENABLED` to `true`. The old `WS_CRON_PUSH` is now gone.
+and will be removed in the future releases.
+
### 2024-08-18
We have started migrating the old events system to a new one, so far we have migrated the `progress` and `requests` to it. As such,
@@ -17,46 +29,6 @@ environment variable `WS_SYNC_PROGRESS` which you can set to `true` to enable th
We will continue to migrate the rest of the events to the new system, and we will keep you updated.
-### 2024-08-10
-
-I have recently added new experimental feature, to play your content directly from the WebUI. This feature is still in
-alpha, and missing a lot of features. But it's a start. Right now it does auto transcode on the fly to play any content in the browser.
-
-The feature requires that you mount your media directories to the `WatchState` container similar to the `File integrity` feature. I have plans to expand
-the feature to support more controls, however, right now it's only support basic subtitles streams and default audio stream or first audio stream.
-
-The transcoder works by converting the media on the fly to `HLS` segments, and the subtitles are selectable via the player ui which are also converted to `vtt` format.
-
-Expects bugs and issues, as the feature is still in alpha. But I would love to hear your feedback. You can play the media by visiting
-the history page of the item you will see red play button on top right corner of the page. If the items has a play button, then you correctly mounted
-the media directories. otherwise, the button be disabled with tooltip of `Media is inaccessible`.
-
-The feature is not meant to replace your backend media player, the purpose of this feature is to quickly check the media without leaving the WebUI.
-
-### 2024-08-01
-
-We recently enabled listening on tls connections via `8443` which can be controlled by `HTTPS_PORT` environment variable.
-Before today, we simply only exposed the port via the `Dockerfile`, but we weren't listening for connections on it.
-
-However, please keep in mind that the certificate is self-signed, and you might get a warning from your browser. You can
-either accept the warning or add the certificate to your trusted certificates. We strongly recommend using a reverse proxy.
-instead of relying on self-signed certificates.
-
-### 2024-07-22
-
-We have recently added a new WebUI feature, `File integrity`, this feature will help you to check if your media backends
-are reporting files that are not available on the disk. This feature is still in alpha, and we are working on improving
-it.
-
-This feature `REQUIRES` that you mount your media directories to the `WatchState` container preferably as readonly. There is plans to add
-a path replacement feature to allow you change the pathing, but it's not implemented yet.
-
-This feature will work on both local and remote cloud storages provided they are mounted into the container. We also may recommend not to
-use this feature depending on how your cloud storage provider treats file stat calls. As it might lead to unnecessary money spending. and of course
-it will be slower.
-
-For more information about how we cache the stat calls, please refer to the [FAQ](FAQ.md#How-does-the-file-integrity-feature-works).
-
Refer to [NEWS](NEWS.md) for old updates.
# Features
diff --git a/config/config.php b/config/config.php
index 0ef1eb14..08d3a273 100644
--- a/config/config.php
+++ b/config/config.php
@@ -9,7 +9,6 @@ use App\Commands\Events\DispatchCommand;
use App\Commands\State\BackupCommand;
use App\Commands\State\ExportCommand;
use App\Commands\State\ImportCommand;
-use App\Commands\State\PushCommand;
use App\Commands\System\IndexCommand;
use App\Commands\System\PruneCommand;
use App\Libs\Mappers\Import\MemoryMapper;
@@ -75,7 +74,10 @@ return (function () {
'header' => (string)env('WS_TRUST_HEADER', 'X-Forwarded-For'),
],
'sync' => [
- 'progress' => (bool)env('WS_SYNC_PROGRESS', false),
+ 'progress' => (bool)env('WS_SYNC_PROGRESS', (bool)env('WS_CRON_PROGRESS', false)),
+ ],
+ 'push' => [
+ 'enabled' => (bool)env('WS_PUSH_ENABLED', (bool)env('WS_CRON_PUSH', false)),
],
];
@@ -266,14 +268,6 @@ return (function () {
'timer' => $checkTaskTimer((string)env('WS_CRON_EXPORT_AT', '30 */1 * * *'), '30 */1 * * *'),
'args' => env('WS_CRON_EXPORT_ARGS', '-v'),
],
- PushCommand::TASK_NAME => [
- 'command' => PushCommand::ROUTE,
- 'name' => PushCommand::TASK_NAME,
- 'info' => 'Send queued events to backends.',
- 'enabled' => (bool)env('WS_CRON_PUSH', true),
- 'timer' => $checkTaskTimer((string)env('WS_CRON_PUSH_AT', '*/10 * * * *'), '*/10 * * * *'),
- 'args' => env('WS_CRON_PUSH_ARGS', '-v'),
- ],
BackupCommand::TASK_NAME => [
'command' => BackupCommand::ROUTE,
'name' => BackupCommand::TASK_NAME,
diff --git a/config/env.spec.php b/config/env.spec.php
index e7b0fc8f..ea0d5381 100644
--- a/config/env.spec.php
+++ b/config/env.spec.php
@@ -166,6 +166,11 @@ return (function () {
'description' => 'Enable watch progress sync.',
'type' => 'bool',
],
+ [
+ 'key' => 'WS_PUSH_ENABLED',
+ 'description' => 'Enable Push play state to backends. This feature depends on webhooks being enabled.',
+ 'type' => 'bool',
+ ],
];
$validateCronExpression = function (string $value): string {
@@ -191,7 +196,7 @@ return (function () {
};
// -- Do not forget to update the tasks list if you add a new task.
- $tasks = ['import', 'export', 'push', 'backup', 'prune', 'indexes'];
+ $tasks = ['import', 'export', 'backup', 'prune', 'indexes'];
$task_env = [
[
'key' => 'WS_CRON_{TASK}',
diff --git a/frontend/pages/events/index.vue b/frontend/pages/events/index.vue
index 03b42aa6..d8798430 100644
--- a/frontend/pages/events/index.vue
+++ b/frontend/pages/events/index.vue
@@ -39,13 +39,14 @@
-