Two-way sync in WatchState helps keep your play progress and watch state synchronized across multiple backends. It’s
called "many-to-many" sync, meaning you can sync data between several backends, and they all stay up to date with each
other. This sync is powered by WatchState's import and export features.
- If you watch a show on Plex and want to continue it on Jellyfin or Emby, two-way sync ensures your progress is saved.
- Keep your media backends synced so you always know where you left off.
WatchState first pulls the latest play and progress information from your backends, then stores it locally this is the
import process. The system checks to ensure the data is up-to-date, and older data is saved as metadata without
overriding the most current watch state.
On the export side, we compare the backend's last sync date with any local changes. From there, we create a list of
items that need updating for each backend. If there are only a few changes, we trigger a quick sync operation
push mode. If the changes are more extensive, we perform a full export, which compares all remote data with the local
data. This full export only happens when there are many changes and/or metadata is missing from the backend, which is
why it's crucial to keep the Enable Import option enabled, or disable it only when you want that
backend to stay in metadata-only mode.
To set up two-way sync, follow the steps below:
First, make sure you have completed the one-way sync guide to get your backends synced.
Go to the Backends page. Here, you'll see two switches for each backend: Import and Export.
- The
Importswitch brings data from the backend into WatchState. - The
Exportswitch sends data from WatchState to the backend.
When you're sure the data looks correct, turn on the Export switch for your main backend and the Import switch for
the others. This will keep your backends synced.
If everything looks good and you want WatchState to automatically sync your backends, do the following:
Go to the Tasks page. Enable the two tasks by toggling the switches next to Import and Export.
To control how often these tasks run, go to the Configuration > Environment page, click the Add
button, and select the environment variables WS_CRON_EXPORT_AT and WS_CRON_IMPORT_AT. These variables use CRON timer
expressions. For example, if you want the export task to run every 6 hours, set WS_CRON_EXPORT_AT to 0 */6 * * *.
For more help with CRON expressions, visit crontab.guru.
Important
The Import task can be resource-intensive, especially for large libraries. It may take some time to complete and
could use a lot of CPU power. It’s recommended to run it a few times a day, with every 6 hours being a good starting
point.
For even faster sync operations, you can enable webhooks. For more details, check out the webhooks guide.
TBA